Attribute VB_Name = "Module1"
Option Explicit
'*****************************************************************************
' Module:
'        Const.inc
'-----------------------------------------------------------------------------
' Description:
'        This file contains global constants. This file should be the same
'        for all controllers.
'
'-----------------------------------------------------------------------------
' History:
'
'        Rev. Author         Date        Description
'        ----------------------------------------------------------------------
'        0.1  Sunil          06-10-04    initial version
'        0.2  Sunil          20-10-04    Added constants  ALT_FUN1, ALT_FUN2 and ALT_FUN3
'        0.3  Sunil          27-12-04    prefixes for modules added.
'
'
'*****************************************************************************

'*****************************************************************************
' @Global Constants
'*****************************************************************************

' format identifiers
Global Const FORMAT_FUNCTIONS = "N30"
Global Const FORMAT_PARAMETERS = "N30"
Global Const FORMAT_FILES = "S80"
Global Const FORMAT_NOTES = "S1000"

' Constants for alternate function number of the pin
Global Const ALT_FUN1 = 1
Global Const ALT_FUN2 = 2
Global Const ALT_FUN3 = 3

' Constants for Clock Frequency in main
Global Const MAIN_PCLK_MIN = 2
''Global Const MAIN_PCLK_MAX = 200
Global Const MAIN_PCLK_MAX = 26.68
Global Const MAIN_FCLK_MIN = 2
Global Const MAIN_FCLK_MAX = 200
'''Global Const MAIN_FCLK_MAX = 53.36

Global Const TO_HIGH = "too high"
Global Const TO_LOW = "too low"

' Modules prefixes

Global Const SCU_PREFIX = ""
Global Const T2_PREFIX = "T2_"
Global Const T2CCU_PREFIX = "T2CCU_"
Global Const T21_PREFIX = "T21_"
Global Const CORE_PREFIX = ""
Global Const T01_PREFIX = ""
Global Const UART_PREFIX = ""
Global Const UART1_PREFIX = "UART1_"
Global Const BRG_PREFIX = ""
Global Const SSC_PREFIX = "SSC_"
Global Const WDT_PREFIX = ""
Global Const FLASH_PREFIX = "FLASH_"
Global Const OCDS_PREFIX = "OCDS_"

Global Const ADC_PREFIX = "ADC_"
Global Const CC6_PREFIX = "CCU6_"


' Page names in the page switching macros
Global Const PORT_PAGE_NAME = "_pp"
Global Const SCU_PAGE_NAME = "_su"
Global Const ADC_PAGE_NAME = "_ad"
Global Const CCU_PAGE_NAME = "_cc"
Global Const T2_PAGE_NAME = "_t2_"
Global Const FLASH_PAGE_NAME = "_fl"

' message box constants
'
' use this constant as text for the MsgBox when the project settings are called
Global Const MSG_CALL_PROJECTSETTINGS = "These basic settings have a major effect on the whole" & vbCrLf & _
                                         "configuration and should therefore be set at the beginning" & vbCrLf & _
                                         "of a project. If any of these settings are reconfigured," & vbCrLf & _
                                         "the peripherals actual configuration should be checked." & vbCrLf & _
                                         "Do you really want to continue ?"
Global Const MSG_SELECT_XINTR5_INTERRUPTS = "Since this interrupt is sharing the interrupt node XINTR5" & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"

                                            
Global Const MSG_SELECT_XINTR6_INTERRUPTS = "Since this interrupt is sharing the interrupt node XINTR6" & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
                                           
                                               
Global Const MSG_SELECT_XINTR7_INTERRUPTS = "Since this interrupt is sharing the interrupt node XINTR7" & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
Global Const MSG_SELECT_XINTR8_INTERRUPTS = "Since this interrupt is sharing the interrupt node XINTR8" & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
                                            
Global Const MSG_SELECT_XINTR9_INTERRUPTS = "Since these interrupts are sharing the interrupt node XINTR9" & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
                                           
Global Const MSG_SELECT_XINTR10_INTERRUPTS = "Since this interrupt node is shared with the interrupt node XINTR10 " & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
Global Const MSG_SELECT_XINTR11_INTERRUPTS = "Since this interrupt node is shared with the interrupt node XINTR11 " & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
Global Const MSG_SELECT_XINTR12_INTERRUPTS = "Since this interrupt node is shared with the interrupt node XINTR12 " & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
Global Const MSG_SELECT_XINTR13_INTERRUPTS = "Since this interrupt node is shared with the interrupt node XINTR13 " & vbCrLf & "Hence the ISR code will be generated in SHARED_INT.C file  only when init function is selected." & vbCrLf & "Do you really want this type of message box to appear for other shared interrupts also?"
Global Const MSGBOX_SHAREDINT_ENABLE = "Shared interrupt message box enable option is provided in project settings page" & vbCrLf & "under global settings section. "
' use this constant as text for the MsgBox when the enable global interrupt is deselected
Global Const MSG_CHANGE_GLOBAL_INTERRUPT = "All interrupts will be disabled by disabling Global Interrupt." & vbCrLf & _
                                            "Do you want to continue ?"

' use this constant as text for the MsgBox when the enable shared interrupt message is deselected
Global Const MSG_CHANGE_SHARED_INTERRUPT = "All Shared interrupt message boxes will be disabled." & vbCrLf & _
                                            "Do you want to continue ?"
' use this constant as text for the MsgBox when the controller type will be changed
Global Const MSG_CHANGE_CONTROLLER = "Any of your settings which are incompatible with the selected" & vbCrLf & _
                                         "controller type will be adjusted without further notification." & vbCrLf & _
                                         "Do you really want to continue ?"

' use this constant as text for the MsgBox when the System clock will be changed
Global Const MSG_CHANGE_SYSTEMCLOCK = "Any of your settings which are dependent from the system clock" & vbCrLf & _
                                         "will be adjusted without further notification." & vbCrLf & _
                                         "Do you really want to continue ?"
                                         
' use this constant as text for the MsgBox when the Clock DIvider CMCON.CLKREL) will be changed
Global Const MSG_CHANGE_CLKREL = "The change in Clock divider will affect System Frequency" & vbCrLf & _
                                         "only when the system is in Slow Down Mode." & vbCrLf & _
                                         "Do you really want to continue ?"

' use this constant as text for the MsgBox when the more than 8 bit address will be used for external interface
Global Const MSG_CHANGE_EBCADDRESS = "Using more than 8 bit addresses might overlap with the on-chip XRAM." & vbCrLf & _
                                         "So, you have to take care for banking." & vbCrLf & _
                                         "Do you really want to continue ?"
' use this constant as text for the MsgBox when the project should be closed
Global Const MSG_CLOSE_PROJECT = "Closing this window closes the project !" & vbCrLf & _
                                         "Do you want to continue ?"


' use this constant as text for the MsgBox when the application should be closed
Global Const MSG_CLOSE_APPLICATION = "Save changes ?"


Global Const MSG_DOCU_BUTTON = "To access all information and documentation related to the selected " & _
                               "peripheral click on the down arrow located on the right."


' caption constants
Global Const CAPTION_FRA_USE_INIT = "Initialization Function"
Global Const CAPTION_FRA_CFILE = "Source File"
Global Const CAPTION_LBL_CFILE = "File name"
Global Const CAPTION_FRA_LIBRARY1 = "Function Library (Part 1)"
Global Const CAPTION_FRA_LIBRARY2 = "Function Library (Part 2)"
Global Const CAPTION_FRA_HFILE = "Header File"
Global Const CAPTION_LBL_HFILE = "File name"
Global Const CAPTION_FRA_PARAMETERS1 = "Parameters (Part 1)"
Global Const CAPTION_FRA_PARAMETERS2 = "Parameters (Part 2)"

'
Global Const CALCULATION_NOT_POSSIBLE = "n.a."

' tooltip constants
Global Const TOOLTIP_DISABLED_IF = "This control is disabled because:"
Global Const TOOLTIP_DISABLED_FUNCTION = "This function is disabled because:"
Global Const TOOLTIP_DISABLED_MACRO = "This macro is disabled because:"
Global Const TOOLTIP_DISABLED_PARAMETER = "This parameter is disabled because:"

' use this constant as first line in the 'DisabledToolTipText' for the description of the ISR's
' on page 'Functions'
Global Const TOOLTIP_DISABLED_ISR = "This function will be automatically selected by DAvE." & vbCrLf

' use this constant as a part of the ISR description (DisabledToolTipText) on page 'Functions'
Global Const TOOLTIP_ISR_USERCODE = "Please note that you have to add application specific " & _
                                           "code to this function."

Global Const TOOLTIP_DISABLED_FUNC_NAME = "This function name or macro name can only be changed " & _
                                           "if the function or macro is selected."
Global Const TOOLTIP_DISABLED_CFILE_NAME = "The source file name can only be changed if " & _
                                           "the initialization function is selected."
Global Const TOOLTIP_DISABLED_HFILE_NAME = "The header file name can only be changed if " & _
                                           "the initialization function is selected."
Global Const TOOLTIP_DISABLED_NOTES = "Notes can only be insert if the initialization " & _
                                           "function is selected."

Global Const TOOLTIP_DESELECTED_INIT = "the initialization function is not selected"

Global Const TOOLTIP_DISABLED_FUNC_SHAREDISR = "Since this is shared with other interrupt hence cannot be edited. "

' title for the code generator
Global Const CODEGEN_TITLE = "DAvE Codegenerator"


' constant strings for the code generator
Global Const SECTION_PROJECT_INCLUDES = _
"//****************************************************************************" & vbCrLf & _
"// @Project Includes" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_MACROS = _
"//****************************************************************************" & vbCrLf & _
"// @Macros" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_DEFINES = _
"//****************************************************************************" & vbCrLf & _
"// @Defines" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_TYPEDEFS = _
"//****************************************************************************" & vbCrLf & _
"// @Typedefs" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_IMPORTED_GLOBAL_VARIABLES = _
"//****************************************************************************" & vbCrLf & _
"// @Imported Global Variables" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_GLOBAL_VARIABLES = _
"//****************************************************************************" & vbCrLf & _
"// @Global Variables" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_EXTERNAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @External Prototypes" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_LOCAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @Prototypes Of Local Functions" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_GLOBAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @Prototypes Of Global Functions" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_INTERRUPT_VECTORS = _
"//****************************************************************************" & vbCrLf & _
"// @Interrupt Vectors" & vbCrLf & _
"//****************************************************************************"

Global Const END_OF_FUNCTION = "//  End of function "

'*****************************************************************************
' @Global Types
'*****************************************************************************



'*****************************************************************************
' @Global Functions
'*****************************************************************************

'*****************************************************************************
'Description:
'        This function returns a string with the description text for the
'        module header in the C file.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with module description
'*****************************************************************************
Function GetModuleHeaderC(ModuleName As String) As String
On Error Resume Next
    GetModuleHeaderC = "This file contains functions that use the " & ModuleName & " module."
End Function


'*****************************************************************************
'Description:
'        This function returns a string with the description text for the
'        module header in the H file.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with module description
'*****************************************************************************
Function GetModuleHeaderH(ModuleName As String) As String
On Error Resume Next
    GetModuleHeaderH = "This file contains all function prototypes and macros for the " & ModuleName & " module."
End Function


'*****************************************************************************
'Description:
'        This function returns an unformatted string with a general description
'        of the init function.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with description
'*****************************************************************************

Function GetGeneralInitDescription(ModuleName As String) As String
    On Error Resume Next
    GetGeneralInitDescription = _
    "This is the initialization function of the " & ModuleName & " function library. " & _
    "It is assumed that the SFRs used by this library are in their reset state. "
End Function
