diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.cproject b/Examples/MAX32650/CLCD_FreeRTOS/.cproject new file mode 100644 index 00000000000..51c0d16d047 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.cproject @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.project b/Examples/MAX32650/CLCD_FreeRTOS/.project new file mode 100644 index 00000000000..9b781da479b --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.project @@ -0,0 +1,26 @@ + + + CLCD_FreeRTOS + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.settings/language.settings.xml b/Examples/MAX32650/CLCD_FreeRTOS/.settings/language.settings.xml new file mode 100644 index 00000000000..d32717b6f37 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.settings/language.settings.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.codan.core.prefs b/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.codan.core.prefs new file mode 100644 index 00000000000..59c0b37ba75 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.codan.core.prefs @@ -0,0 +1,93 @@ +eclipse.preferences.version=1 +org.eclipse.cdt.codan.checkers.errnoreturn=Warning +org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false} +org.eclipse.cdt.codan.checkers.errreturnvalue=Error +org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"} +org.eclipse.cdt.codan.checkers.nocommentinside=-Error +org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"} +org.eclipse.cdt.codan.checkers.nolinecomment=-Error +org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"} +org.eclipse.cdt.codan.checkers.noreturn=Error +org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false} +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"} +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"} +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"} +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"} +org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"C-Style cast instead of C++ cast\\")"} +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false} +org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning +org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"} +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true} +org.eclipse.cdt.codan.internal.checkers.CopyrightProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.CopyrightProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Lack of copyright information\\")",regex\=>".*Copyright.*"} +org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=Error +org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"} +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Goto statement used\\")"} +org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error +org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"} +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"} +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"} +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"} +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.MissCaseProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.MissCaseProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing cases in switch\\")"} +org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing default in switch\\")",defaultWithAllEnums\=>false} +org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing reference return value in assignment operator\\")"} +org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing self check in assignment operator\\")"} +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"} +org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error +org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"} +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"} +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"} +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"} +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"} +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false} +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false} +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")} +org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Using directive in header\\")"} +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem=-Error +org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Virtual method call in constructor/destructor\\")"} +org.eclipse.cdt.qt.core.qtproblem=Warning +org.eclipse.cdt.qt.core.qtproblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_ON_FILE_OPEN\=>true,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>null} diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.core.prefs b/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 00000000000..1066cd0b35d --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/BOARD/delimiter=; +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/BOARD/operation=append +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/BOARD/value=EvKit_V1 +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/GCC_PREFIX/delimiter=; +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/GCC_PREFIX/operation=replace +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/GCC_PREFIX/value=arm-none-eabi- +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/PROJECT/delimiter=; +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/PROJECT/operation=append +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/PROJECT/value=CLCD_FreeRTOS +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/TARGET/delimiter=; +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/TARGET/operation=append +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/TARGET/value=MAX32650 +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/append=true +environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1028364529/appendContributed=true diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/README.md b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/README.md new file mode 100644 index 00000000000..5b355bd51c9 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/README.md @@ -0,0 +1,47 @@ +# VSCode-Maxim + +_(If you're viewing this document from within Visual Studio Code you can press `CTRL+SHIFT+V` to open a Markdown preview window.)_ + +## Quick Links + +* [MSDK User Guide](https://analogdevicesinc.github.io/msdk/USERGUIDE/) +* [VSCode-Maxim Github](https://github.com/analogdevicesinc/VSCode-Maxim) + +## Introduction + +VSCode-Maxim is a set of [Visual Studio Code](https://code.visualstudio.com/) project configurations and utilities for enabling embedded development for [Analog Device's MSDK](https://github.com/analogdevicesinc/msdk) and the [MAX32xxx/MAX78xxx microcontrollers](https://www.analog.com/en/product-category/microcontrollers.html). + +The following features are supported: + +* Code editing with intellisense down to the register level +* Code compilation with the ability to easily re-target a project for different microcontrollers and boards +* Flashing programs +* GUI and command-line debugging + +## Dependencies + +* [Visual Studio Code](https://code.visualstudio.com/) + * [C/C++ VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) + * [Cortex-Debug Extension](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) +* [Analog Devices MSDK](https://analogdevicesinc.github.io/msdk/) + +## Installation + +Install the MSDK, then set `"MAXIM_PATH"` in your _user_ VS Code settings. + +See [Getting Started with Visual Studio Code](https://analogdevicesinc.github.io/msdk/USERGUIDE/#getting-started-with-visual-studio-code) in the MSDK User Guide for detailed instructions. + +## Usage + +See the [MSDK User Guide](https://analogdevicesinc.github.io/msdk/USERGUIDE/#visual-studio-code) for detailed usage info. + +## Issue Tracker + +Bug reports, feature requests, and contributions are welcome via the [issues](https://github.com/analogdevicesinc/VSCode-Maxim/issues) tracker on Github. + +New issues should contain _at minimum_ the following information: + +* Visual Studio Code version #s (see `Help -> About`) +* C/C++ Extension version # +* Target microcontroller and evaluation platform +* The projects `.vscode` folder and `Makefile` (where applicable). Standard compression formats such as `.zip`, `.rar`, `.tar.gz`, etc. are all acceptable. diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/c_cpp_properties.json b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/c_cpp_properties.json new file mode 100644 index 00000000000..b043b809363 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/c_cpp_properties.json @@ -0,0 +1,55 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [ + "${default}" + ], + "intelliSenseMode": "windows-gcc-x64", + "compilerPath": "C:/msys64/mingw64/bin/gcc.exe", + "browse": { + "path": [ + "${default}" + ] + }, + "cStandard": "${default}", + "cppStandard": "${default}" + }, + { + "name": "Linux", + "includePath": [ + "${default}" + ], + "defines": [ + "${default}" + ], + "intelliSenseMode": "gcc-arm", + "compilerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gcc", + "browse": { + "path": [ + "${default}" + ] + } + }, + { + "name": "Mac", + "includePath": [ + "${default}" + ], + "defines": [ + "${default}" + ], + "intelliSenseMode": "gcc-arm", + "compilerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gcc", + "browse": { + "path": [ + "${default}" + ] + } + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/flash.gdb b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/flash.gdb new file mode 100644 index 00000000000..8f22801a47d --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/flash.gdb @@ -0,0 +1,17 @@ +define flash_m4 + set architecture armv7e-m + set remotetimeout 10 + target remote | openocd -c "gdb_port pipe;log_output flash.log" -s $arg0/scripts -f interface/$arg1 -f target/$arg2 -c "init; reset halt" + load + compare-sections + monitor reset halt +end + +define flash_m4_run + set architecture armv7e-m + set remotetimeout 10 + target remote | openocd -c "gdb_port pipe;log_output flash.log" -s $arg0/scripts -f interface/$arg1 -f target/$arg2 -c "init; reset halt" + load + compare-sections + monitor resume +end diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/launch.json b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/launch.json new file mode 100644 index 00000000000..c3d7a82a4d7 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/launch.json @@ -0,0 +1,209 @@ +{ + "configurations": [ + { + "name": "Debug Arm (Cortex-debug)", + "cwd": "${workspaceRoot}", + "executable": "${workspaceFolder}/build/${config:program_file}", + "loadFiles": [ + "${workspaceFolder}/build/${config:program_file}" + ], + "symbolFiles": [ + { + "file": "${workspaceFolder}/build/${config:symbol_file}" + } + ], + "request": "launch", + "type": "cortex-debug", + "servertype": "openocd", + "linux": { + "gdbPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb", + "serverpath": "${config:OCD_path}/openocd" + }, + "windows": { + "gdbPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb.exe", + "serverpath": "${config:OCD_path}/openocd.exe" + }, + "osx": { + "gdbPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb", + "serverpath": "${config:OCD_path}/openocd" + }, + "searchDir": [ + "${config:OCD_path}/scripts" + ], + "configFiles": [ + "interface/${config:M4_OCD_interface_file}", + "target/${config:M4_OCD_target_file}" + ], + "interface": "swd", + "runToEntryPoint": "main", + "svdFile": "${config:MAXIM_PATH}/Libraries/CMSIS/Device/Maxim/${config:target}/Include/${config:target}.svd" + }, + { + "name": "GDB (Arm M4)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/${config:program_file}", + "args": [], + "stopAtEntry": true, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "linux": { + "miDebuggerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb", + "debugServerPath": "${config:OCD_path}/openocd" + }, + "windows": { + "miDebuggerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb.exe", + "debugServerPath": "${config:OCD_path}/openocd.exe" + }, + "osx": { + "miDebuggerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gdb", + "debugServerPath": "${config:OCD_path}/bin/openocd" + }, + "logging": { + "exceptions": true, + "trace": false, + "traceResponse": false, + "engineLogging": false + }, + "miDebuggerServerAddress": "localhost:3333", + "debugServerArgs": "-s ${config:OCD_path}/scripts -f interface/${config:M4_OCD_interface_file} -f target/${config:M4_OCD_target_file} -c \"init; reset halt\"", + "serverStarted": "Info : Listening on port 3333 for gdb connections", + "filterStderr": true, + "targetArchitecture": "arm", + "customLaunchSetupCommands": [ + { + "text": "-list-features" + } + ], + "setupCommands": [ + { + "text": "set logging overwrite on" + }, + { + "text": "set logging file debug-arm.log" + }, + { + "text": "set logging on" + }, + { + "text": "cd ${workspaceFolder}" + }, + { + "text": "exec-file build/${config:program_file}" + }, + { + "text": "symbol-file build/${config:symbol_file}" + }, + { + "text": "target remote localhost:3333" + }, + { + "text": "monitor reset halt" + }, + { + "text": "set $pc=Reset_Handler" + }, + { + "text": "b main" + } + ] + }, + { + "name": "GDB (RISC-V)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/buildrv/${config:program_file}", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "linux": { + "miDebuggerPath": "${config:xPack_GCC_path}/bin/riscv-none-elf-gdb", + "debugServerPath": "${config:OCD_path}/openocd" + }, + "windows": { + "miDebuggerPath": "${config:xPack_GCC_path}/bin/riscv-none-elf-gdb.exe", + "debugServerPath": "${config:OCD_path}/openocd.exe" + }, + "osx": { + "miDebuggerPath": "${config:xPack_GCC_path}/bin/riscv-none-elf-gdb", + "debugServerPath": "${config:OCD_path}/bin/openocd" + }, + "logging": { + "exceptions": true, + "trace": false, + "traceResponse": false, + "engineLogging": false + }, + "miDebuggerServerAddress": "localhost:3334", + "debugServerArgs": "-c \"gdb_port 3334\" -s ${config:OCD_path}/scripts -f interface/${config:RV_OCD_interface_file} -f target/${config:RV_OCD_target_file}", + "serverStarted": "Info : Listening on port 3334 for gdb connections", + "filterStderr": true, + "customLaunchSetupCommands": [ + { + "text": "-list-features" + } + ], + "targetArchitecture": "arm", + "setupCommands": [ + { + "text": "set logging overwrite on" + }, + { + "text": "set logging file debug-riscv.log" + }, + { + "text": "set logging on" + }, + { + "text": "cd ${workspaceFolder}" + }, + { + "text": "set architecture riscv:rv32", + "ignoreFailures": false + }, + { + "text": "exec-file build/${config:program_file}", + "ignoreFailures": false + }, + { + "text": "symbol-file buildrv/${config:symbol_file}", + "ignoreFailures": false + }, + { + "text": "target remote localhost:3334" + }, + { + "text": "b main" + }, + { + "text": "set $pc=Reset_Handler", + "ignoreFailures": false + } + ] + }, + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "c:/Workspace/MSDK_Development/brentk-adi-fork/Examples/MAX32650/CLCD_FreeRTOS", + "program": "c:/Workspace/MSDK_Development/brentk-adi-fork/Examples/MAX32650/CLCD_FreeRTOS/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/settings.json b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/settings.json new file mode 100644 index 00000000000..ae20d60e51c --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/settings.json @@ -0,0 +1,138 @@ +{ + "terminal.integrated.env.windows": { + "Path": "${config:OCD_path};${config:ARM_GCC_path}/bin;${config:xPack_GCC_path}/bin;${config:MSYS_path}/usr/bin;${config:Make_path};${env:PATH}", + "MAXIM_PATH": "${config:MAXIM_PATH}" + }, + "terminal.integrated.defaultProfile.windows": "Command Prompt", + "terminal.integrated.env.linux": { + "PATH": "${config:OCD_path}:${config:ARM_GCC_path}/bin:${config:xPack_GCC_path}/bin:${config:Make_path}:${env:PATH}", + "MAXIM_PATH": "${config:MAXIM_PATH}" + }, + "terminal.integrated.env.osx": { + "PATH": "${config:OCD_path}/bin:${config:ARM_GCC_path}/bin:${config:xPack_GCC_path}/bin:${config:Make_path}:${env:PATH}", + "MAXIM_PATH": "${config:MAXIM_PATH}" + }, + "target": "MAX32650", + "board": "EvKit_V1", + "project_name": "${workspaceFolderBasename}", + "program_file": "${config:project_name}.elf", + "symbol_file": "${config:program_file}", + "M4_OCD_interface_file": "cmsis-dap.cfg", + "M4_OCD_target_file": "max32650.cfg", + "RV_OCD_interface_file": "ftdi/olimex-arm-usb-ocd-h.cfg", + "RV_OCD_target_file": "${config:target}_riscv.cfg", + "v_Arm_GCC": "10.3", + "v_xPack_GCC": "12.2.0-3.1", + "OCD_path": "${config:MAXIM_PATH}/Tools/OpenOCD", + "ARM_GCC_path": "${config:MAXIM_PATH}/Tools/GNUTools/${config:v_Arm_GCC}", + "xPack_GCC_path": "${config:MAXIM_PATH}/Tools/xPack/riscv-none-elf-gcc/${config:v_xPack_GCC}", + "Make_path": "${config:MAXIM_PATH}/Tools/GNUTools/Make", + "MSYS_path": "${config:MAXIM_PATH}/Tools/MSYS2", + "C_Cpp.default.includePath": [ + "${workspaceFolder}", + "${workspaceFolder}/**", + "${config:MAXIM_PATH}/Libraries/Boards/${config:target}/Include", + "${config:MAXIM_PATH}/Libraries/Boards/${config:target}/${config:board}/Include", + "${config:MAXIM_PATH}/Libraries/CMSIS/Device/Maxim/${config:target}/Include", + "${config:MAXIM_PATH}/Libraries/CMSIS/Include", + "${config:ARM_GCC_path}/arm-none-eabi/include", + "${config:ARM_GCC_path}/lib/gcc/arm-none-eabi/${config:v_Arm_GCC}/include", + "${config:MAXIM_PATH}/Libraries/PeriphDrivers/Include/${config:target}", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Camera", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Display", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Display/fonts", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/ExtMemory", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/LED", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/PMIC", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/PushButton", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Touchscreen", + "${config:MAXIM_PATH}/Libraries/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source/include", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM4F", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source/portable/GCC/RISC-V" + ], + "C_Cpp.default.browse.path": [ + "${workspaceFolder}", + "${config:MAXIM_PATH}/Libraries/Boards/${config:target}/Source", + "${config:MAXIM_PATH}/Libraries/Boards/${config:target}/${config:board}/Source", + "${config:MAXIM_PATH}/Libraries/PeriphDrivers/Source", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Camera", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Display", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Display/fonts", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/LED", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/PMIC", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/PushButton", + "${config:MAXIM_PATH}/Libraries/MiscDrivers/Touchscreen", + "${config:MAXIM_PATH}/Libraries/MiscDrivers", + "${config:MAXIM_PATH}/Libraries/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM4F", + "${config:MAXIM_PATH}/Libraries/FreeRTOS/Source/portable/GCC/RISC-V" + ], + "C_Cpp.default.defines": [], + "C_Cpp.default.forcedInclude": [ + "${workspaceFolder}/build/project_defines.h" + ], + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false, + "files.associations": { + "usagetrace.h": "c", + "core_cm4.h": "c", + "lcd_task.h": "c" + } +} \ No newline at end of file diff --git a/Examples/MAX32650/CLCD_FreeRTOS/.vscode/tasks.json b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/tasks.json new file mode 100644 index 00000000000..e95445e2b3e --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/.vscode/tasks.json @@ -0,0 +1,115 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "clean", + "type": "shell", + "command": "make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "clean-periph", + "type": "shell", + "command": "make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "flash", + "type": "shell", + "command": "arm-none-eabi-gdb", + "args": [ + "--cd=\"${workspaceFolder}\"", + "--se=\"build/${config:program_file}\"", + "--symbols=build/${config:symbol_file}", + "-x=\"${workspaceFolder}/.vscode/flash.gdb\"", + "--ex=\"flash_m4 ${config:OCD_path} ${config:M4_OCD_interface_file} ${config:M4_OCD_target_file}\"", + "--batch" + ], + "group": "build", + "problemMatcher": [], + "dependsOn":["build"] + }, + { + "label": "flash & run", + "type": "shell", + "command": "arm-none-eabi-gdb", + "args": [ + "--cd=\"${workspaceFolder}\"", + "--se=\"build/${config:program_file}\"", + "--symbols=build/${config:symbol_file}", + "-x=\"${workspaceFolder}/.vscode/flash.gdb\"", + "--ex=\"flash_m4_run ${config:OCD_path} ${config:M4_OCD_interface_file} ${config:M4_OCD_target_file}\"", + "--batch" + ], + "group": "build", + "problemMatcher": [], + "dependsOn":["build"] + }, + { + "label": "erase flash", + "type": "shell", + "command": "openocd", + "args": [ + "-s", "${config:OCD_path}/scripts", + "-f", "interface/${config:M4_OCD_interface_file}", + "-f", "target/${config:M4_OCD_target_file}", + "-c", "\"init; reset halt; max32xxx mass_erase 0;\"", + "-c", "exit" + ], + "group":"build", + "problemMatcher": [], + "dependsOn":[] + }, + { + "label": "openocd (m4)", + "type": "shell", + "command": "openocd", + "args": [ + "-s", + "${config:OCD_path}/scripts", + "-f", + "interface/${config:M4_OCD_interface_file}", + "-f", + "target/${config:M4_OCD_target_file}", + "-c", + "\"init; reset halt\"" + ], + "problemMatcher": [], + "dependsOn":[] + }, + { + "label": "gdb (m4)", + "type": "shell", + "command": "arm-none-eabi-gdb", + "args": [ + "--ex=\"cd ${workspaceFolder}\"", + "--se=\"build/${config:program_file}\"", + "--symbols=build/${config:symbol_file}", + "--ex=\"target remote localhost:3333\"", + "--ex=\"monitor reset halt\"", + "--ex=\"b main\"", + "--ex=\"c\"" + ], + "problemMatcher": [], + "dependsOn":[] + }, + ] +} \ No newline at end of file diff --git a/Examples/MAX32650/CLCD_FreeRTOS/CLCD_FreeRTOS.launch b/Examples/MAX32650/CLCD_FreeRTOS/CLCD_FreeRTOS.launch new file mode 100644 index 00000000000..5967931ccf3 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/CLCD_FreeRTOS.launch @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOSConfig.h b/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOSConfig.h new file mode 100644 index 00000000000..5e0cfa4b534 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOSConfig.h @@ -0,0 +1,110 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +#ifndef EXAMPLES_MAX32650_CLCD_FREERTOS_FREERTOSCONFIG_H_ +#define EXAMPLES_MAX32650_CLCD_FREERTOS_FREERTOSCONFIG_H_ + +#include +#include "max32650.h" + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +extern uint32_t SystemCoreClock; +#endif + +#define configCPU_CLOCK_HZ (SystemCoreClock) + +#define configTICK_RATE_HZ ((portTickType)1000) +#define configRTC_TICK_RATE_HZ (32768) + +#define configTOTAL_HEAP_SIZE ((size_t)(16 * 1024)) + +#define configMINIMAL_STACK_SIZE ((uint16_t)128) + +#define configMAX_PRIORITIES 5 +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configUSE_CO_ROUTINES 0 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 + +/* Run time and task stats gathering related definitions. */ +#define configUSE_TRACE_FACILITY 1 +#define configUSE_STATS_FORMATTING_FUNCTIONS 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 0 +#define INCLUDE_vTaskDelete 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelay 1 + +/* # of priority bits (configured in hardware) is provided by CMSIS */ +#define configPRIO_BITS __NVIC_PRIO_BITS + +/* Priority 7, or 255 as only the top three bits are implemented. This is the lowest priority. */ +#define configKERNEL_INTERRUPT_PRIORITY ((unsigned char)7 << (8 - configPRIO_BITS)) + +/* Priority 5, or 160 as only the top three bits are implemented. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ((unsigned char)5 << (8 - configPRIO_BITS)) + +/* Alias the default handler names to match CMSIS weak symbols */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler +#define xPortSysTickHandler SysTick_Handler + +/* FreeRTOS+CLI requires this size to be defined, but we do not use it */ +#define configCOMMAND_INT_MAX_OUTPUT_SIZE 1 + +// MSDK Debug flags +#if defined(DEBUG) && DEBUG == 1 +// RTOS Stats Timer Functions +extern void ConfigTimerForStats(void); +extern uint32_t GetTimerForStats(void); +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() (ConfigTimerForStats()) +#define portGET_RUN_TIME_COUNTER_VALUE() (GetTimerForStats()) +#define configGENERATE_RUN_TIME_STATS 1 + +// RTOS Assert & other debug configuration +#define configASSERT(x) \ + if ((x) == 0) { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) {} \ + } +#define configENABLE_BACKWARD_COMPATIBILITY 1 +#define configQUEUE_REGISTRY_SIZE 10 +#define configRECORD_STACK_HIGH_ADDRESS 1 + +#endif + +#endif //EXAMPLES_MAX32650_CLCD_FREERTOS_FREERTOSCONFIG_H_ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOS_Debug.c b/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOS_Debug.c new file mode 100644 index 00000000000..b6576a27223 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/FreeRTOS_Debug.c @@ -0,0 +1,124 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/** + * @file FreeRTOS_Debug.c + * @brief FreeRTOS Debug utilities including RTOS Stats Timer + * and template HardFault Handler + */ + +#include "FreeRTOS.h" +#include "task.h" +#include "tmr.h" +#include "nvic_table.h" + +// Only include the contents of this file if DEBUG == 1 +#if defined(DEBUG) && (DEBUG == 1) + +// Scheduler tick is 1ms +// RTOS Stats Clock should be 10-100x faster +// MAX32650 Timers are based on PCLK. Prescale 1024 = 58kHz +#define RTOS_STATS_TMR MXC_TMR0 +#define RTOS_STATS_TMR_PSCALE MXC_TMR_PRES_1024 +#define RTOS_STATS_TMR_CNT 0xFFFFFFFF + +/** NOTE: + * Based on this configuration, this timer will roll over after 2^32 / (TMR_SRC / prescaler) seconds. + * Because the RTOS tracks the total time, rollover events cannot be protected by the application. + * Thus, rollover events will affect statistics over long periods of measurement. + **/ +void ConfigTimerForStats() +{ + mxc_tmr_cfg_t tmr; + + MXC_TMR_Shutdown(RTOS_STATS_TMR); + + tmr.pres = RTOS_STATS_TMR_PSCALE; + tmr.mode = TMR_MODE_CONTINUOUS; + tmr.cmp_cnt = RTOS_STATS_TMR_CNT; + tmr.pol = 0; + MXC_TMR_Init(RTOS_STATS_TMR, &tmr); + + MXC_TMR_Start(RTOS_STATS_TMR); +} + +uint32_t GetTimerForStats() +{ + return MXC_TMR_GetCount(RTOS_STATS_TMR); +} + +/* For this debugging function, the register values are loaded into variables + * to be viewed in a debugging context easier. The compiler will complain if + * warnings are enabled, so disable those warnings just for this function + * to filter out build notifications + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +void prvGetRegistersFromStack(uint32_t *pulFaultStackAddress) +{ + /* These are volatile to try and prevent the compiler/linker optimising them + away as the variables never actually get used. If the debugger won't show the + values of the variables, make them global my moving their declaration outside + of this function. */ + volatile uint32_t r0; + volatile uint32_t r1; + volatile uint32_t r2; + volatile uint32_t r3; + volatile uint32_t r12; + volatile uint32_t lr; /* Link register. */ + volatile uint32_t pc; /* Program counter. */ + volatile uint32_t psr; /* Program status register. */ + + r0 = pulFaultStackAddress[0]; + r1 = pulFaultStackAddress[1]; + r2 = pulFaultStackAddress[2]; + r3 = pulFaultStackAddress[3]; + + r12 = pulFaultStackAddress[4]; + lr = pulFaultStackAddress[5]; + pc = pulFaultStackAddress[6]; + psr = pulFaultStackAddress[7]; + + /* When the following line is hit, the variables contain the register values. */ + for (;;) {} +} +#pragma GCC diagnostic pop + +void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) +{ + for (;;) {} +} + +/* The prototype shows it is a naked function - in effect this is just an +assembly function. */ +void HardFault_Handler(void) __attribute__((naked, aligned(8))); + +/* The fault handler implementation calls a function called +prvGetRegistersFromStack(). */ +void HardFault_Handler(void) +{ + __asm volatile(" tst lr, #4 \n" + " ite eq \n" + " mrseq r0, msp \n" + " mrsne r0, psp \n" + " ldr r1, [r0, #24] \n" + " ldr r2, handler2_address_const \n" + " bx r2 \n" + " handler2_address_const: .word prvGetRegistersFromStack \n"); +} +#endif diff --git a/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.c b/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.c new file mode 100644 index 00000000000..0fe9b161949 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.c @@ -0,0 +1,360 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#include +#include +#include +#include + +#include "FreeRTOS.h" +#include "FreeRTOSConfig.h" +#include "portable.h" +#include "semphr.h" +#include "task.h" + +#include "clcd.h" +#include "clcd_regs.h" +#include "nvic_table.h" + +#include "LCD_Task.h" +#include "UsageTrace.h" + +/* Update rate for the frame buffer. This drives the FreeRTOS delay time */ +#define FRAME_RATE_MS (1000 / 3) + +/* Panel information */ +#define PANEL_W 320 +#define PANEL_H 240 + +/* Helper constant for drawing colors bars */ +#define COLOR_BAR_COUNT 8 + +/* FreeRTOS task handle */ +static TaskHandle_t lcdTask; + +/* Slightly different operation if double buffering is enabled. Double buffering + * should eliminate any flickering related to drawing while the display is + * updating, at the cost of an additional frame buffer + * + * The variable activeFrame is used for both single and double buffering by the + * task to make code portable + */ +#ifdef LCD_DOUBLE_BUFFER +/* Support for double buffering, Has 2 frame buffers, controlled via a FreeRTOS + * semaphore to ensure frames aren't redrawn mid-update + */ +static uint32_t frameBuffer[2][PANEL_W * PANEL_H] __attribute__((aligned(32))); +static uint32_t *activeFrame; //Frame active for drawing +static uint32_t *runningFrame; //Frame running in the controller +static SemaphoreHandle_t newFrameSem; //Sem that a new frame is ready to show +static SemaphoreHandle_t emptyFrameSem; //Sem that a buffer is avail to draw +#else +/* Frame buffer + * Note: This assumes 24-bits per pixel, word packed to 32. For other bit-depts + * or palletized colors, this buffer will need to change type and/or size. + * However, the 32-bit alignment is required by the peripheral + */ +static uint32_t activeFrame[PANEL_W * PANEL_H] __attribute__((aligned(32))); +#endif + +/* Local Prototypes */ +static void LCD_TaskBody(void *pvParameters); +static void LCD_DrawColorBars(uint32_t *buf); +static void LCD_DrawTaskStats(uint32_t *buf); +static void LCD_DrawTextString(uint32_t *buf, const char *str, uint32_t color); +static int LCD_DrawCharacter(uint32_t *buf, char ch, uint32_t color); +static void LCD_ISR_Handler(void); + +/** + * Initializes the LCD task. Configures the LCD peripheral for the panel and + * kicks off the FreeRTOS task. +*/ +void LCD_TaskInitialize() +{ + mxc_clcd_cfg_t panel; + + panel.width = PANEL_W; //Set the size of the panel in pixels + panel.height = PANEL_H; //Set the width of the panel in pixels + panel.frequency = 6400000; //minimum panel supported frequency + panel.vfrontporch = 2; + panel.vbackporch = 2; + panel.vsyncwidth = 10; + panel.hfrontporch = 12; + panel.hbackporch = 2; + panel.hsyncwidth = 70; + panel.bpp = MXC_BPP24; //24-bit per pixel + panel.palette = NULL; //Only palletized for lower bit depths + panel.paletteSize = 0; + + //Initialize the peripheral + MXC_CLCD_Init(&panel); + +#ifdef LCD_DOUBLE_BUFFER + /* For double buffering, create the semaphores and initialize the empty + * frame as available to draw, and the newFrame as not yet ready + */ + newFrameSem = xSemaphoreCreateBinary(); + emptyFrameSem = xSemaphoreCreateBinary(); + xSemaphoreTake(newFrameSem, 0); + xSemaphoreGive(emptyFrameSem); + activeFrame = frameBuffer[0]; + runningFrame = frameBuffer[1]; + memset(runningFrame, 0, sizeof(uint32_t) * PANEL_W * PANEL_H); + MXC_CLCD_SetFrameAddr((void *)runningFrame); + + //Setup the system to get interrupts from the LCD + MXC_NVIC_SetVector(LCD_IRQn, LCD_ISR_Handler); + NVIC_SetPriority(LCD_IRQn, configMAX_PRIORITIES); + NVIC_EnableIRQ(LCD_IRQn); + + //Set interrupts on Address Ready + MXC_CLCD->int_en = MXC_S_CLCD_INT_EN_ADDR_RDY_IE_EN; +#else + memset(activeFrame, 0, sizeof(uint32_t) * PANEL_W * PANEL_H); + MXC_CLCD_SetFrameAddr((void *)activeFrame); +#endif + + //Enable the CLCD to display the image + MXC_CLCD_Enable(); + + //Create the LCD task + xTaskCreate(LCD_TaskBody, (const char *)"LCD", 1024, NULL, tskIDLE_PRIORITY + 2, &lcdTask); +} + +/** + * Task body for the LCD task. Periodically draw the updated display. +*/ +void LCD_TaskBody(void *pvParameters) +{ + while (1) //Loop forever + { +//When double buffering, need to wait for a frame to be ready +#ifdef LCD_DOUBLE_BUFFER + xSemaphoreTake(emptyFrameSem, portMAX_DELAY); +#endif + + //Track time spent here + _UsageTraceStart(); + +#if defined(LCD_DISP_COLORBARS) + LCD_DrawColorBars(activeFrame); +#elif defined(LCD_DISP_TASK_STATS) + LCD_DrawTaskStats(activeFrame); +#else +//You can add your own drawing routine here +#error "No Display type defined" +#endif + + //Track time spent here + _UsageTraceEnd(); + +//When double buffering, notify of a new frame ready +#ifdef LCD_DOUBLE_BUFFER + xSemaphoreGive(newFrameSem); +#endif + + //Delay until the next frame. This will give us a close match to the + //desired frame rate. Because of the time it takes to actually do the + //drawing, we'll be a bit slower. A more exact implementation would use + //a timer and have this task wake up at the frame rate period, versus + //delaying + vTaskDelay(FRAME_RATE_MS / portTICK_PERIOD_MS); + } +} + +/** + * Interrupt handler for the LCD. This specifically looks for the Address ready + * bit, and if a new frame is available does a buffer swap +*/ +static void LCD_ISR_Handler() +{ + //Get and clear all the flags + uint32_t flags = MXC_CLCD->int_stat; + MXC_CLCD->int_stat = flags; + +#ifdef LCD_DOUBLE_BUFFER + BaseType_t higherPriorityWoken = 0; + uint32_t *tempAddr; + if (flags & MXC_F_CLCD_INT_STAT_ADDR_RDY) //Address is available for update + { + //Try to take a new frame semaphore, only swap frames if successful + if (xSemaphoreTakeFromISR(newFrameSem, &higherPriorityWoken) == pdTRUE) { + tempAddr = runningFrame; + runningFrame = activeFrame; + MXC_CLCD_SetFrameAddr((void *)runningFrame); + activeFrame = tempAddr; + + //Let the task know they can draw on activeFrame again + xSemaphoreGiveFromISR(emptyFrameSem, &higherPriorityWoken); + } + } +#endif +} + +#ifdef LCD_DISP_TASK_STATS +/* Buffer for holding task information. + * FreeRTOS recommends 40 chars per task. Arbitrarily assume 20 tasks or less + */ +#define MAX_TASK_STATUS 20 +static char taskStatusBuf[MAX_TASK_STATUS * 40]; + +/* Grab the font from the MSDK's Provided Library */ +extern const unsigned char Liberation_Sans16x16[]; + +/** + * Helper for accessing font data. For the 16x16 font, the first byte is the + * width of the character in pixels, following by 16, 16-bitmapped vertical + * columns + */ +#pragma pack(1) +typedef struct { + uint8_t width; + uint16_t vertPixels[16]; +} font16x16_helper_t; +#pragma pack() + +/* The Font table in the .C has 4 bytes of header info, skip ahead to the chars */ +static const font16x16_helper_t *fontTable = (font16x16_helper_t *)&(Liberation_Sans16x16[4]); + +/** + * Draws the task statistics from FreeRTOS onto the screen based on the data + * provided by vTaskGetRunTimeStats() + * + * It is assumed the buf + * pointer is the correct depth and size per the PANEL_W and PANEL_H constants. + * + * @param buf - Frame buffer to draw + */ +static void LCD_DrawTaskStats(uint32_t *buf) +{ + //Clean slate. Could be smarter here an just erase area's we've touched + memset(buf, 0, sizeof(uint32_t) * PANEL_W * PANEL_H); + + snprintf(taskStatusBuf, sizeof(taskStatusBuf), "Tick Count: %u", xTaskGetTickCount()); + LCD_DrawTextString(buf + (PANEL_W * 5), taskStatusBuf, 0xFFFFFFFF); + vTaskGetRunTimeStats(taskStatusBuf); + LCD_DrawTextString(buf + (PANEL_W * 22), taskStatusBuf, 0xFFFFFFFF); +} + +/** + * Draws a string of text on the display. Buf represents the upper left corner + * of the display to draw. Will automatically jump lines when a '\n' is + * seen. Loops until a '\0' is found. + * + * @param buf - Buffer to draw into + * @param str - String to draw + * @param color - Color to use +*/ +static void LCD_DrawTextString(uint32_t *buf, const char *str, uint32_t color) +{ + uint32_t *workingBuf = buf; + uint32_t *lineStart = buf; + while (*str != '\0') { + if (*str == '\n') { + lineStart += PANEL_W * 17; + workingBuf = lineStart; + } else { + workingBuf += LCD_DrawCharacter(workingBuf, *str, color) + 1; + } + str++; + } +} + +/** + * Draws a character on the location of the screen. Buf is the upper left pixel + * location. Returns the width of the pixel drawn + * + * @param buf - Buffer to draw into + * @param ch - Character to draw + * @param color - Color to use + * @returns Widdth in pixels of the character drawn +*/ +static int LCD_DrawCharacter(uint32_t *buf, char ch, uint32_t color) +{ + uint32_t *workingBuf; + const font16x16_helper_t *charData; + + //The font supports ' ' through '~'. If outside that range, draw a space + if ((ch < ' ') || (ch > '~')) { + ch = ' '; + } + + //Grab the pixel data + charData = &fontTable[ch - ' ']; + + //For each row in the font + for (int y = 0; y < 16; y++) { + //Get the start of the row + workingBuf = buf + (PANEL_W * y); + + //For each column in the font + for (int x = 0; x < 16; x++) { + //Font is based on vertical pixels, so mask is based on y + if (charData->vertPixels[x] & (1U << y)) { + *workingBuf++ = color; + } else { + *workingBuf++ = 0x00; + } + } + } + + return charData->width; +} +#endif //LCD_DISP_TASK_STATS + +#ifdef LCD_DISP_COLORBARS +/* Color definitions for drawing color bars */ +static const uint32_t colors[COLOR_BAR_COUNT] = { 0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF, + 0x00FF0000, 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF }; + +/** + * Draws a simple color bar test pattern in the buffer. It is assumed the buf + * pointer is the correct depth and size per the PANEL_W and PANEL_H constants. + * + * This does a 'rolling' color bar, where the location of the bars shift by 1 + * column on every refresh. + * + * @param buf - Frame buffer to draw + */ +static void LCD_DrawColorBars(uint32_t *buf) +{ + static uint8_t colorIdx = 0; //Non-volatile tracking of color index + + uint32_t *ptr = buf; + uint32_t color; + + //Loop the height of the frame + for (int y = 0; y < PANEL_H; y++) { + //Loop through each color + for (int i = 0; i < COLOR_BAR_COUNT; i++) { + //Grab the next colors + color = colors[colorIdx]; + + //Divide the width evenly + for (int x = 0; x < (PANEL_W / COLOR_BAR_COUNT); x++) { + *ptr++ = color; + } + + //Increment the color index + colorIdx = (colorIdx + 1) % COLOR_BAR_COUNT; + } + } + + //Once again at the end to give a rotating effect + colorIdx = (colorIdx + 1) % COLOR_BAR_COUNT; +} +#endif //LCD_DISP_COLORBARS diff --git a/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.h b/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.h new file mode 100644 index 00000000000..a4450603bc1 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/LCD_Task.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#ifndef EXAMPLES_MAX32650_CLCD_FREERTOS_LCD_TASK_H_ +#define EXAMPLES_MAX32650_CLCD_FREERTOS_LCD_TASK_H_ + +/* Initializes the LCD and starts the FreeRTOS task */ +void LCD_TaskInitialize(void); + +#endif //EXAMPLES_MAX32650_CLCD_FREERTOS_LCD_TASK_H_ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/LiberationSans16x16.c b/Examples/MAX32650/CLCD_FreeRTOS/LiberationSans16x16.c new file mode 100644 index 00000000000..19c01385222 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/LiberationSans16x16.c @@ -0,0 +1,306 @@ +//Digitized data copyright (c) 2010 Google Corporation +// with Reserved Font Arimo, Tinos and Cousine. +//Copyright (c) 2012 Red Hat, Inc. +// with Reserved Font Name Liberation. +// +//This Font Software is licensed under the SIL Open Font License, +//Version 1.1, see LICENSE +// +//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0 +//MikroElektronika 2011 +//http://www.mikroe.com + +//GLCD FontName : Liberation_Sans16x16 +//GLCD FontSize : 16 x 16 + +const unsigned char Liberation_Sans16x16[] = { + 33, 16, 16, 2, // number of bytes per character; horizontal size in pixels; vertical size in pixels; number of bytes per vertical line + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1B, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ! + 0x06, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char " + 0x0A, 0x00, 0x00, 0x10, 0x02, 0x10, 0x1E, 0xF0, 0x03, 0x1E, 0x02, + 0x10, 0x02, 0x10, 0x1E, 0xF8, 0x03, 0x16, 0x02, 0x10, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char # + 0x0A, 0x00, 0x00, 0x00, 0x08, 0x3C, 0x18, 0x66, 0x10, 0x42, 0x10, + 0xFF, 0x3F, 0xC2, 0x10, 0x82, 0x10, 0x84, 0x0F, 0x00, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $ + 0x0E, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x42, 0x00, 0x42, 0x10, + 0x7E, 0x0C, 0x00, 0x06, 0x80, 0x01, 0x60, 0x00, 0x38, 0x00, 0x8C, + 0x1F, 0x82, 0x10, 0x80, 0x10, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, // Code for char % + 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x19, 0xF8, 0x10, + 0xC4, 0x11, 0x44, 0x13, 0x64, 0x0E, 0x38, 0x0C, 0x00, 0x1B, 0x80, + 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char & + 0x03, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ' + 0x06, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x3C, 0x78, 0x06, 0xC0, + 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ( + 0x05, 0x00, 0x00, 0x02, 0x80, 0x06, 0xC0, 0x3C, 0x78, 0xE0, 0x0F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ) + 0x07, 0x00, 0x00, 0x08, 0x00, 0x48, 0x00, 0x38, 0x00, 0x3E, 0x00, + 0x48, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char * + 0x09, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, + 0xF0, 0x07, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char + + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char , + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char - + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char . + 0x05, 0x00, 0x00, 0x00, 0x18, 0x80, 0x07, 0x78, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char / + 0x09, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0x04, 0x0C, 0x02, 0x10, + 0x02, 0x10, 0x02, 0x10, 0x04, 0x0C, 0xF8, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0 + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x10, 0x06, 0x10, + 0xFE, 0x1F, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1 + 0x09, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x06, 0x1C, 0x02, 0x12, + 0x02, 0x11, 0x82, 0x10, 0xEE, 0x10, 0x3C, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2 + 0x09, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06, 0x18, 0x42, 0x10, + 0x42, 0x10, 0x62, 0x10, 0xF6, 0x18, 0x9C, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3 + 0x0A, 0x00, 0x00, 0x00, 0x02, 0x80, 0x03, 0xC0, 0x02, 0x30, 0x02, + 0x1C, 0x02, 0x06, 0x02, 0xFE, 0x1F, 0x00, 0x02, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4 + 0x09, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x08, 0x4E, 0x18, 0x22, 0x10, + 0x22, 0x10, 0x22, 0x10, 0x62, 0x08, 0xC2, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5 + 0x09, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0xCC, 0x0C, 0x22, 0x10, + 0x22, 0x10, 0x22, 0x10, 0x66, 0x18, 0xC4, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6 + 0x09, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x1E, + 0xC2, 0x07, 0x72, 0x00, 0x1A, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7 + 0x09, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x0F, 0xA6, 0x18, 0x42, 0x10, + 0x42, 0x10, 0x42, 0x10, 0xA6, 0x18, 0xBC, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8 + 0x09, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x08, 0x86, 0x19, 0x02, 0x11, + 0x02, 0x11, 0x02, 0x11, 0x8C, 0x0C, 0xF8, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9 + 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x30, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char : + 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x30, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ; + 0x09, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x40, 0x01, 0x40, 0x01, + 0x60, 0x03, 0x20, 0x02, 0x20, 0x02, 0x10, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char < + 0x09, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, + 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char = + 0x09, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x20, 0x02, 0x20, 0x02, + 0x60, 0x03, 0x40, 0x01, 0x40, 0x01, 0xC0, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char > + 0x09, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x02, 0x18, + 0x02, 0x1B, 0x82, 0x00, 0xC6, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ? + 0x10, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x70, 0x1C, 0x18, 0x30, + 0x84, 0x27, 0xE4, 0x4C, 0x32, 0x48, 0x12, 0x48, 0x12, 0x44, 0x32, + 0x42, 0xE2, 0x2F, 0x34, 0x28, 0x0C, 0x0C, 0x38, 0x07, 0xE0, 0x00, // Code for char @ + 0x0C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x1E, 0x80, 0x03, 0xF0, 0x01, + 0x1E, 0x01, 0x02, 0x01, 0x1E, 0x01, 0xF0, 0x01, 0x80, 0x03, 0x00, + 0x1E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x42, 0x10, + 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x66, 0x10, 0xBC, 0x0C, 0x80, + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B + 0x0C, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x1C, 0x0F, 0x04, 0x08, + 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, + 0x08, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C + 0x0C, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x02, 0x10, + 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x18, 0x04, 0x08, 0x1C, + 0x0E, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x42, 0x10, + 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x42, 0x10, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E + 0x0A, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x82, 0x00, + 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F + 0x0C, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x1C, 0x0E, 0x04, 0x08, + 0x02, 0x10, 0x02, 0x10, 0x82, 0x10, 0x82, 0x10, 0x86, 0x18, 0x8C, + 0x0F, 0x88, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x40, 0x00, + 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xFE, 0x1F, 0xFE, + 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char H + 0x03, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x10, 0x02, 0x10, + 0x02, 0x10, 0xFE, 0x0F, 0xFE, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0xC0, 0x00, + 0x60, 0x00, 0xF0, 0x01, 0x18, 0x03, 0x0C, 0x06, 0x06, 0x0C, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char K + 0x09, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x00, 0x10, + 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L + 0x0D, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x3C, 0x00, + 0xE0, 0x00, 0x00, 0x07, 0x00, 0x18, 0x00, 0x0F, 0xE0, 0x01, 0x3C, + 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char M + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x1C, 0x00, + 0x30, 0x00, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x0C, 0xFE, 0x1F, 0xFE, + 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N + 0x0C, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x03, 0x1C, 0x0E, 0x04, 0x08, + 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0x1C, + 0x0E, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x82, 0x00, + 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x6C, 0x00, 0x7C, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P + 0x0C, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x03, 0x1C, 0x0E, 0x04, 0x08, + 0x02, 0x10, 0x02, 0x10, 0x02, 0x70, 0x02, 0xD0, 0x04, 0x88, 0x1C, + 0x8E, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Q + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0x82, 0x00, + 0x82, 0x00, 0x82, 0x00, 0x82, 0x01, 0x82, 0x07, 0x7C, 0x1C, 0x38, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char R + 0x0B, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x3C, 0x08, 0x66, 0x10, + 0x42, 0x10, 0x42, 0x10, 0xC2, 0x10, 0x82, 0x10, 0x8C, 0x09, 0x0C, + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S + 0x0A, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, + 0xFE, 0x1F, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T + 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x03, 0xFE, 0x0F, 0x00, 0x18, + 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x18, 0xFE, 0x0F, 0xFE, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U + 0x0C, 0x00, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x78, 0x00, 0xC0, 0x03, + 0x00, 0x0E, 0x00, 0x10, 0x00, 0x0E, 0xC0, 0x03, 0x78, 0x00, 0x1E, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V + 0x10, 0x00, 0x00, 0x06, 0x00, 0x3E, 0x00, 0xF0, 0x03, 0x00, 0x1F, + 0x00, 0x1C, 0xC0, 0x07, 0x7C, 0x00, 0x06, 0x00, 0x7C, 0x00, 0xC0, + 0x07, 0x00, 0x1C, 0x00, 0x1E, 0xE0, 0x03, 0x3E, 0x00, 0x06, 0x00, // Code for char W + 0x0B, 0x00, 0x00, 0x00, 0x00, 0x02, 0x18, 0x0E, 0x0C, 0x18, 0x07, + 0xB0, 0x01, 0xC0, 0x00, 0xF0, 0x01, 0x18, 0x07, 0x0E, 0x0C, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X + 0x09, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x1C, 0x00, 0x70, 0x00, + 0xC0, 0x1F, 0x70, 0x00, 0x1C, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y + 0x0A, 0x00, 0x00, 0x00, 0x10, 0x02, 0x1C, 0x02, 0x16, 0x82, 0x13, + 0xE2, 0x10, 0x32, 0x10, 0x1E, 0x10, 0x06, 0x10, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Z + 0x05, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x02, 0x80, 0x02, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [ + 0x05, 0x00, 0x00, 0x06, 0x00, 0x78, 0x00, 0x80, 0x07, 0x00, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash + 0x04, 0x00, 0x00, 0x02, 0x80, 0x02, 0x80, 0xFE, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ] + 0x08, 0x00, 0x00, 0x40, 0x00, 0x70, 0x00, 0x0E, 0x00, 0x02, 0x00, + 0x0E, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^ + 0x0A, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _ + 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ` + 0x0A, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0E, 0x30, 0x13, 0x10, 0x11, + 0x10, 0x11, 0x10, 0x09, 0xF0, 0x0F, 0xC0, 0x1F, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a + 0x09, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0xEE, 0x0F, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x30, 0x18, 0xE0, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b + 0x08, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x30, 0x18, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c + 0x09, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x30, 0x18, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0xFE, 0x0F, 0xFE, 0x1F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d + 0x09, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x30, 0x19, 0x10, 0x11, + 0x10, 0x11, 0x10, 0x11, 0x30, 0x19, 0xE0, 0x09, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e + 0x05, 0x00, 0x00, 0x10, 0x00, 0xFC, 0x1F, 0xFE, 0x1F, 0x12, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f + 0x09, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x4F, 0x30, 0xD8, 0x10, 0x90, + 0x10, 0x90, 0x30, 0x88, 0xC0, 0x7F, 0xF0, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g + 0x08, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x60, 0x00, 0x10, 0x00, + 0x10, 0x00, 0x30, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h + 0x04, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x1F, 0xF2, 0x1F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i + 0x03, 0x00, 0x00, 0x00, 0x80, 0xF2, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j + 0x09, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x03, 0x80, 0x01, + 0xC0, 0x03, 0x60, 0x0E, 0x30, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k + 0x03, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l + 0x0D, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0x60, 0x00, 0x10, 0x00, + 0x10, 0x00, 0x10, 0x00, 0xE0, 0x1F, 0x20, 0x00, 0x10, 0x00, 0x10, + 0x00, 0x30, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char m + 0x08, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0x60, 0x00, 0x10, 0x00, + 0x10, 0x00, 0x30, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n + 0x09, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x30, 0x18, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x30, 0x18, 0xE0, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o + 0x09, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xE0, 0xEF, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x30, 0x18, 0xE0, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p + 0x09, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x30, 0x18, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0xE0, 0xEF, 0xF0, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q + 0x06, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x1F, 0x60, 0x00, 0x10, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r + 0x08, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x08, 0x90, 0x11, 0x10, 0x11, + 0x10, 0x11, 0x10, 0x13, 0x20, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s + 0x05, 0x00, 0x00, 0x10, 0x00, 0xFC, 0x1F, 0xFC, 0x1F, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t + 0x08, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x18, 0x00, 0x10, + 0x00, 0x10, 0x00, 0x0C, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u + 0x08, 0x00, 0x00, 0x30, 0x00, 0xF0, 0x01, 0x00, 0x1F, 0x00, 0x10, + 0x00, 0x0F, 0xF0, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v + 0x0C, 0x00, 0x00, 0x30, 0x00, 0xE0, 0x03, 0x00, 0x1E, 0x00, 0x1E, + 0xE0, 0x03, 0x10, 0x00, 0xE0, 0x03, 0x00, 0x1C, 0x00, 0x1E, 0xE0, + 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char w + 0x08, 0x00, 0x00, 0x00, 0x10, 0x30, 0x18, 0xE0, 0x06, 0x80, 0x01, + 0xE0, 0x06, 0x30, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x + 0x08, 0x00, 0x00, 0x10, 0x80, 0xF0, 0x81, 0x80, 0xCF, 0x00, 0x78, + 0x00, 0x0F, 0xF0, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y + 0x07, 0x00, 0x00, 0x00, 0x00, 0x10, 0x1C, 0x10, 0x16, 0x90, 0x13, + 0xF0, 0x10, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z + 0x06, 0x00, 0x00, 0x00, 0x01, 0x80, 0x03, 0xFE, 0xFE, 0x02, 0x80, + 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char { + 0x03, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char | + 0x06, 0x00, 0x00, 0x02, 0x80, 0x02, 0x80, 0xFE, 0xFE, 0x80, 0x03, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char } + 0x09, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x40, 0x00, 0x40, 0x00, + 0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ~ + 0x04, 0x00, 0x00, 0xFC, 0x0F, 0x04, 0x08, 0xFC, 0x0F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char  +}; diff --git a/Examples/MAX32650/CLCD_FreeRTOS/Makefile b/Examples/MAX32650/CLCD_FreeRTOS/Makefile new file mode 100644 index 00000000000..7cc647840b1 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/Makefile @@ -0,0 +1,382 @@ +############################################################################### + # + # Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + # Analog Devices, Inc.), + # Copyright (C) 2023-2024 Analog Devices, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # + ############################################################################## + +# ** Readme! ** +# Don't edit this file! This is the core Makefile for a MaximSDK +# project. The available configuration options can be overridden +# in "project.mk", on the command-line, or with system environment +# variables. + +# See https://analogdevicesinc.github.io/msdk/USERGUIDE/#build-system +# for more detailed instructions on how to use this system. + +# The detailed instructions mentioned above are easier to read than +# this file, but the comments found in this file also outline the +# available configuration variables. This file is organized into +# sub-sections, some of which expose config variables. + + +# ******************************************************************************* +# Set the target microcontroller and board to compile for. + +# Every TARGET microcontroller has some Board Support Packages (BSPs) that are +# available for it under the MaximSDK/Libraries/Boards/TARGET folder. The BSP +# that gets selected is MaximSDK/Libraries/Boards/TARGET/BOARD. + +# Configuration Variables: +# - TARGET : Override the default target microcontroller. Ex: TARGET=MAX78000 +# - BOARD : Override the default BSP (case sensitive). Ex: BOARD=EvKit_V1, BOARD=FTHR_RevA + + +ifeq "$(TARGET)" "" +# Default target microcontroller +TARGET := MAX32650 +TARGET_UC := MAX32650 +TARGET_LC := max32650 +else +# "TARGET" has been overridden in the environment or on the command-line. +# We need to calculate an upper and lowercase version of the part number, +# because paths on Linux and MacOS are case-sensitive. +TARGET_UC := $(subst m,M,$(subst a,A,$(subst x,X,$(TARGET)))) +TARGET_LC := $(subst M,m,$(subst A,a,$(subst X,x,$(TARGET)))) +endif + +# Default board. +BOARD ?= EvKit_V1 + +# ******************************************************************************* +# Locate the MaximSDK + +# This Makefile needs to know where to find the MaximSDK, and the MAXIM_PATH variable +# should point to the root directory of the MaximSDK installation. Setting this manually +# is usually only required if you're working on the command-line. + +# If MAXIM_PATH is not specified, we assume the project still lives inside of the MaximSDK +# and move up from this project's original location. + +# Configuration Variables: +# - MAXIM_PATH : Tell this Makefile where to find the MaximSDK. Ex: MAXIM_PATH=C:/MaximSDK + + +ifneq "$(MAXIM_PATH)" "" +# Sanitize MAXIM_PATH for backslashes +MAXIM_PATH := $(subst \,/,$(MAXIM_PATH)) +# Locate some other useful paths... +LIBS_DIR := $(abspath $(MAXIM_PATH)/Libraries) +CMSIS_ROOT := $(LIBS_DIR)/CMSIS +endif + +# ******************************************************************************* +# Include project Makefile. We do this after formulating TARGET, BOARD, and MAXIM_PATH +# in case project.mk needs to reference those values. However, we also include +# this as early as possible in the Makefile so that it can append to or override +# the variables below. + + +PROJECTMK ?= $(abspath ./project.mk) +include $(PROJECTMK) +$(info Loaded project.mk) +# PROJECTMK is also used by implicit rules and other libraries to add project.mk as a watch file + +# ******************************************************************************* +# Final path sanitization and re-calculation. No options here. + +ifeq "$(MAXIM_PATH)" "" +# MAXIM_PATH is still not defined... +DEPTH := ../../../ +MAXIM_PATH := $(abspath $(DEPTH)) +$(warning Warning: MAXIM_PATH is not set! Set MAXIM_PATH in your environment or in project.mk to clear this warning.) +$(warning Warning: Attempting to use $(MAXIM_PATH) calculated from relative path) +else +# Sanitize MAXIM_PATH for backslashes +MAXIM_PATH := $(subst \,/,$(MAXIM_PATH)) +endif + +# Final recalculation of LIBS_DIR/CMSIS_ROOT +LIBS_DIR := $(abspath $(MAXIM_PATH)/Libraries) +CMSIS_ROOT := $(LIBS_DIR)/CMSIS + +# One final UC/LC check in case user set TARGET in project.mk +TARGET_UC := $(subst m,M,$(subst a,A,$(subst x,X,$(TARGET)))) +TARGET_LC := $(subst M,m,$(subst A,a,$(subst X,x,$(TARGET)))) + +export TARGET +export TARGET_UC +export TARGET_LC +export CMSIS_ROOT +# TODO: Remove dependency on exports for these variables. + +# ******************************************************************************* +# Set up search paths, and auto-detect all source code on those paths. + +# The following paths are searched by default, where "./" is the project directory. +# ./ +# |- *.h +# |- *.c +# |-include (optional) +# |- *.h +# |-src (optional) +# |- *.c + +# Configuration Variables: +# - VPATH : Tell this Makefile to search additional locations for source (.c) files. +# You should use the "+=" operator with this option. +# Ex: VPATH += your/new/path +# - IPATH : Tell this Makefile to search additional locations for header (.h) files. +# You should use the "+=" operator with this option. +# Ex: VPATH += your/new/path +# - SRCS : Tell this Makefile to explicitly add a source (.c) file to the build. +# This is really only useful if you want to add a source file that isn't +# on any VPATH, in which case you can add the full path to the file here. +# You should use the "+=" operator with this option. +# Ex: SRCS += your/specific/source/file.c +# - AUTOSEARCH : Set whether this Makefile should automatically detect .c files on +# VPATH and add them to the build. This is enabled by default. Set +# to 0 to disable. If autosearch is disabled, source files must be +# manually added to SRCS. +# Ex: AUTOSEARCH = 0 + + +# Where to find source files for this project. +VPATH += . +VPATH += src +VPATH := $(VPATH) + +# Where to find header files for this project +IPATH += . +IPATH += include +IPATH := $(IPATH) + +AUTOSEARCH ?= 1 +ifeq ($(AUTOSEARCH), 1) +# Auto-detect all C/C++ source files on VPATH +SRCS += $(wildcard $(addsuffix /*.c, $(VPATH))) +SRCS += $(wildcard $(addsuffix /*.cpp, $(VPATH))) +endif + +# Collapse SRCS before passing them on to the next stage +SRCS := $(SRCS) + +# ******************************************************************************* +# Set the output filename + +# Configuration Variables: +# - PROJECT : Override the default output filename. Ex: PROJECT=MyProject + + +# The default value creates a file named after the target micro. Ex: MAX78000.elf +PROJECT ?= $(TARGET_LC) + +# ******************************************************************************* +# Compiler options + +# Configuration Variables: +# - DEBUG : Set DEBUG=1 to build explicitly for debugging. This adds some additional +# symbols and sets -Og as the default optimization level. +# - MXC_OPTIMIZE_CFLAGS : Override the default compiler optimization level. +# Ex: MXC_OPTIMIZE_CFLAGS = -O2 +# - PROJ_CFLAGS : Add additional compiler flags to the build. +# You should use the "+=" operator with this option. +# Ex: PROJ_CFLAGS += -Wextra +# - MFLOAT_ABI : Set the floating point acceleration level. +# The only options are "hard", "soft", or "softfp". +# Ex: MFLOAT_ABI = hard +# - LINKERFILE : Override the default linkerfile. +# Ex: LINKERFILE = customlinkerfile.ld +# - LINKERPATH : Override the default search location for $(LINKERFILE) +# The default search location is $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC +# If $(LINKERFILE) cannot be found at this path, then the root project +# directory will be used as a fallback. + +# Select 'GCC' or 'IAR' compiler +ifeq "$(COMPILER)" "" +COMPILER := GCC +endif + +# Set default compiler optimization levels +ifeq "$(MAKECMDGOALS)" "release" +# Default optimization level for "release" builds (make release) +MXC_OPTIMIZE_CFLAGS ?= -O2 +DEBUG = 0 +endif + +ifeq ($(DEBUG),1) +# Optimizes for debugging as recommended +# by GNU for code-edit-debug cycles +# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options +MXC_OPTIMIZE_CFLAGS := -Og +endif + +# Default level if not building for release or explicitly for debug +MXC_OPTIMIZE_CFLAGS ?= -Og + +# Set compiler flags +PROJ_CFLAGS += -Wall # Enable warnings +PROJ_CFLAGS += -DMXC_ASSERT_ENABLE + +# Set hardware floating point acceleration. +# Options are: +# - hard +# - soft +# - softfp (default if MFLOAT_ABI is not set) +MFLOAT_ABI ?= softfp +# MFLOAT_ABI must be exported to other Makefiles +export MFLOAT_ABI + +# This path contains system-level intialization files for the target micro. Add to the build. +VPATH += $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source + +# ******************************************************************************* +# Secure Boot Tools (SBT) + +# This section integrates the Secure Boot Tools. It's intended for use with +# microcontrollers that have a secure bootloader. + +# Enabling SBT integration will add some special rules, such as "make sla", "make scpa", etc. + +# Configuration variables: +# SBT : Toggle SBT integration. Set to 1 to enable, or 0 +# to disable +# MAXIM_SBT_DIR : Specify the location of the SBT tool binaries. This defaults to +# Tools/SBT in the MaximSDK. The standalone SBT installer will override +# this via an environment variable. +# TARGET_SEC : Specify the part number to be passed into the SBT. This should match +# the secure variant part #. The default value will depend on TARGET. +# For example, TARGET=MAX32650 will result in TARGET_SEC=MAX32651, and +# the default selection happens in Tools/SBT/SBT-config. +# However, if there are multiple secure part #s for the target +# microcontroller this variable may need to be changed. + +SBT ?= 0 +ifeq ($(SBT), 1) +MAXIM_SBT_DIR ?= $(MAXIM_PATH)/Tools/SBT +MAXIM_SBT_DIR := $(subst \,/,$(MAXIM_SBT_DIR)) +# ^ Must sanitize path for \ on Windows, since this may come from an environment +# variable. + +export MAXIM_SBT_DIR # SBTs must have this environment variable defined to work + +# SBT-config.mk and SBT-rules.mk are included further down this Makefile. + +endif # SBT + +# ******************************************************************************* +# Default goal selection. This section allows you to override the default goal +# that will run if no targets are specified on the command-line. +# (ie. just running 'make' instead of 'make all') + +# Configuration variables: +# .DEFAULT_GOAL : Set the default goal if no targets were specified on the +# command-line +# ** "override" must be used with this variable. ** +# Ex: "override .DEFAULT_GOAL = mygoal" + +ifeq "$(.DEFAULT_GOAL)" "" +ifeq ($(SBT),1) +override .DEFAULT_GOAL := sla +else +override .DEFAULT_GOAL := all +endif +endif + +# Developer note: 'override' is used above for legacy Makefile compatibility. +# gcc.mk/gcc_riscv.mk need to hard-set 'all' internally, so this new system +# uses 'override' to come in over the top without breaking old projects. + +# It's also necessary to explicitly set MAKECMDGOALS... +ifeq "$(MAKECMDGOALS)" "" +MAKECMDGOALS:=$(.DEFAULT_GOAL) +endif + +# Enable colors when --sync-output is used. +# See https://www.gnu.org/software/make/manual/make.html#Terminal-Output (section 13.2) +ifneq ($(MAKE_TERMOUT),) +PROJ_CFLAGS += -fdiagnostics-color=always +endif + +ifneq ($(FORCE_COLOR),) +PROJ_CFLAGS += -fdiagnostics-color=always +endif + +# ******************************************************************************* +# Include SBT config. We need to do this here because it needs to know +# the current MAKECMDGOAL. +ifeq ($(SBT),1) +include $(MAXIM_PATH)/Tools/SBT/SBT-config.mk +endif + +# ******************************************************************************* +# Libraries + +# This section offers "toggle switches" to include or exclude the libraries that +# are available in the MaximSDK. Set a configuration variable to 1 to include the +# library in the build, or 0 to exclude. + +# Each library may also have its own library specific configuration variables. See +# Libraries/libs.mk for more details. + +# Configuration variables: +# - LIB_BOARD : Include the Board-Support Package (BSP) library. (Enabled by default) +# - LIB_PERIPHDRIVERS : Include the peripheral driver library. (Enabled by default) +# - LIB_CMSIS_DSP : Include the CMSIS-DSP library. +# - LIB_CORDIO : Include the Cordio BLE library +# - LIB_FCL : Include the Free Cryptographic Library (FCL) +# - LIB_FREERTOS : Include the FreeRTOS and FreeRTOS-Plus-CLI libraries +# - LIB_LC3 : Include the Low Complexity Communication Codec (LC3) library +# - LIB_LITTLEFS : Include the "little file system" (littleFS) library +# - LIB_LWIP : Include the lwIP library +# - LIB_MAXUSB : Include the MAXUSB library +# - LIB_SDHC : Include the SDHC library + +include $(LIBS_DIR)/libs.mk + + +# ******************************************************************************* +# Rules + +# Include the rules for building for this target. All other makefiles should be +# included before this one. +include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk + +# Include the rules that integrate the SBTs. SBTs are a special case that must be +# include after the core gcc rules to extend them. +ifeq ($(SBT), 1) +include $(MAXIM_PATH)/Tools/SBT/SBT-rules.mk +endif + + +# Get .DEFAULT_GOAL working. +ifeq "$(MAKECMDGOALS)" "" +MAKECMDGOALS:=$(.DEFAULT_GOAL) +endif + + +all: +# Extend the functionality of the "all" recipe here + arm-none-eabi-size --format=berkeley $(BUILD_DIR)/$(PROJECT).elf + +libclean: + $(MAKE) -f ${PERIPH_DRIVER_DIR}/periphdriver.mk clean.periph + +clean: +# Extend the functionality of the "clean" recipe here + +# The rule to clean out all the build products. +distclean: clean libclean diff --git a/Examples/MAX32650/CLCD_FreeRTOS/README.md b/Examples/MAX32650/CLCD_FreeRTOS/README.md new file mode 100644 index 00000000000..be76e58f7ce --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/README.md @@ -0,0 +1,148 @@ +# Description + +This example demonstrates use of the LCD within a FreeRTOS application. + +In addition to providing display support, the application optionally utilizes +double buffering to eliminate display flicker, and provides several trace and +debug options for measuring execution time of code. + +## Display Example + +The provided display example utilizes a FreeRTOS task to periodically update the +display at a 3Hz. The refresh rate can be adjusted through the `FRAME_RATE_MS` +constant in LCD_Task.c. + +The display example has two different graphics options + - FreeRTOS Stats (default) - Displays the run time statistics for running tasks + - Colorbars - Displays generic colorbar test pattern with a rotating effect. + +### Page Flipping / Double Buffering + +The display task has an optional (enabled by default) double buffering +capability through the use of page flipping. Two frame buffers are utilized, +one is actively being drawn by the display controller, and the other is free to +be updated by the display task. The flipping is synchronized with the Address +Ready interrupt of the display controller, and is protected by FreeRTOS +semaphores to ensure frame data is not changed while being redrawn to the screen. +This use of page flipping eliminates flickering and tearing artifacts that can +occur while the actively displayed frame buffer is modified. + +## Usage Tracing + +This project also incorporates several CPU usage features to track the execution +time and utilization of the display task. These concepts can easily by migrated +to other tasks or applications. + +### FreeRTOS Run-Time Stats + +FreeRTOS run time stats are enabled through the `configGENERATE_RUN_TIME_STATS` +definition in FreeRTOSConfig.h. This, along with the assigned timer and +supporting functions, allow FreeRTOS to track the amount of CPU time each +individual task is utilizing, relative to the whole system. + +The run time statistics may be accessed in code through the `vTaskGetRunTimeStats()` +function. This method populates a string buffer, and is by default printed to +the console of this application (via the BackgroundTask) and shown on the LCD. + +It is also possible to get the run time statistics from a debugging context. +Utilizing VS Code as the development IDE, the XRTOS tab may be used. This comes +installed as a default when using the Cortex-Debug extension. With the +application running in the debugger, pause execution and view the XRTOS tab. +The task run times will be populated with the RTOS data. In addition, with the +`configRECORD_STACK_HIGH_ADDRESS` definition in FreeRTOSConfig.h, the stack +usage and high watermark will also be shown. + +![XRTOS Output](doc/xrtos.png) + +### Execution Time Tracing + +To provide a detailed look at the executing time for a specific block of code, +two methods are provided with the UsageTrace implementation. To measure a block +of code with the executing time tracing, wrap the block with `_UsageTraceStart()` +and `_UsageTraceEnd()` respectively. + +Due to interrupts potential running during the code block, the UsageTrace code +can optionally be compiled to disable interrupts during the measured block. This +should only be used for measurement and debug, and not recommended for release +code. + +#### GPIO Tracing + +GPIO Tracing uses a spare GPIO pin on the device to set its state high while +the specified block of code running. With this pin, you can utilize an +oscilloscope or other test equipment to accurately measure run time and see the +frequency of the code running. The default GPIO assigned for this application +is P2.0. + +![GPIO Output](doc/gpio_output.png) ![GPIO Output](doc/gpio_output2.png) + +#### Timer Tracing + +Timer tracing uses a spare timer peripheral to count ticks that elapsed during +the code block executing. The UsageTrace module has a prototype for function +`UsageTraceUserHook()` which needs to be implemented by the user to handle the +completion of each code block event. In this demo application, the hook simply +just prints the results to the console + +``` +void UsageTraceUserHook(uint32_t count, usage_src_t src) +{ + printf("Usage: %d %d\n", count, src); +} +``` + +# Software + +## Project Usage + +Universal instructions on building, flashing, and debugging this project can be found in the **[MSDK User Guide](https://analogdevicesinc.github.io/msdk/USERGUIDE/)**. + +## Project-Specific Build Notes + +There are several user configurable options to tailor what aspects of this +project are run. While these #defines can be added to the source code, it +is recommended they are incorporated with PROJ_CFLAGS variable in the project.mk +file. + +| Definition | Description | Default | +| ---------- | ----------- |-| +| `LCD_DISP_COLORBARS` | Displays a colorbar pattern on the screen. | | +| `LCD_DISP_TASK_STATS` | Displays the FreeRTOS task stats on the screen. | Y | +| `LCD_DOUBLE_BUFFER` | Uses double buffering for the display. | Y | +| `USAGE_NO_IRQ` | Disables interrupts when tracing usage. | Y | +| `USAGE_GPIO_OUT` | Enables GPIO toggling for usage tracing. | Y | +| `USAGE_TMR` | Enables Timer counts for usage tracing. | Y | + +## Required Connections + +- Connect a USB cable between the PC and the CN2 (USB/PWR) connector. +- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1. + +## Expected Output + +Using the default build definitions, the default console output will be the +FreeRTOS task statistics every 10 seconds, as well as the output from the +`UsageTraceUserHook()` on each call. + +``` +Usage: 252014 0 +Usage: 251702 0 +Usage: 251327 0 +Usage: 251709 0 +Usage: 251197 0 +Usage: 251433 0 +==================== +Tick Count: 540542 +Background 33527 <1 +IDLE 31522282 98 +LCD 400989 1 +==================== +Usage: 251116 0 +Usage: 251423 0 +Usage: 250642 0 +Usage: 250764 0 +Usage: 251576 0 +Usage: 251805 0 +``` + + diff --git a/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.c b/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.c new file mode 100644 index 00000000000..88bffa2c568 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.c @@ -0,0 +1,48 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#include "UsageTrace.h" + +/** + * Initializes the UsageTrace functionality. Needs to be called before Start and + * End are used +*/ +void UsageTraceInit() +{ +#ifdef USAGE_GPIO_OUT + mxc_gpio_cfg_t gpioCfg; + gpioCfg.port = USAGE_GPIO_PORT; + gpioCfg.mask = USAGE_GPIO_PIN; + gpioCfg.drvstr = MXC_GPIO_DRVSTR_0; + gpioCfg.func = MXC_GPIO_FUNC_OUT; + gpioCfg.pad = MXC_GPIO_PAD_NONE; + gpioCfg.vssel = MXC_GPIO_VSSEL_VDDIO; + USAGE_GPIO_PORT->out_clr = USAGE_GPIO_PIN; + MXC_GPIO_Config(&gpioCfg); +#endif + +#ifdef USAGE_TMR + mxc_tmr_cfg_t tmrCfg; + MXC_TMR_Shutdown(USAGE_TMR_INST); + tmrCfg.pres = MXC_TMR_PRES_1; + tmrCfg.mode = TMR_MODE_CONTINUOUS; + tmrCfg.cmp_cnt = 0xFFFFFFFF; + tmrCfg.pol = 0; + MXC_TMR_Init(USAGE_TMR_INST, &tmrCfg); + MXC_TMR_Start(USAGE_TMR_INST); +#endif +} diff --git a/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.h b/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.h new file mode 100644 index 00000000000..128aeb4a909 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/UsageTrace.h @@ -0,0 +1,110 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#ifndef EXAMPLES_MAX32650_CLCD_FREERTOS_USAGETRACE_H_ +#define EXAMPLES_MAX32650_CLCD_FREERTOS_USAGETRACE_H_ +#include "gpio.h" +#include "mxc_device.h" +#include "tmr.h" + +/**************************************** + * This code intends to provide a basic wrapper of functionality for tracking + * amount of time spent in a block of code. It provides several methods for + * doing so, enabled by the various #defines: + * + * - USAGE_TMR - Measure time in a code block using a timer peripheral + * - USAGE_GPIO_OUT - Set a GPIO high while the block is executing + * - USAGE_NO_IRQ - Disable interrupts while this block is running +*/ + +/* If USAGE_TMR, configure the peripheral timer */ +#ifdef USAGE_TMR +#define USAGE_TMR_INST MXC_TMR3 +#endif + +/* If USAGE_GPIO_OUT, configure the GPIO signal */ +#ifdef USAGE_GPIO_OUT +#define USAGE_GPIO_PORT MXC_GPIO2 +#define USAGE_GPIO_PIN MXC_GPIO_PIN_0 +#endif + +/* Enum used for notifying the source during the hook*/ +typedef enum { USAGE_SRC_TMR } usage_src_t; + +/** + * Initializes the UsageTrace functionality. Needs to be called before Start and + * End are used +*/ +void UsageTraceInit(void); + +/** + * Prototype type for the UserHook. For timer based tracing, it is up to the + * user to implement this and determine what to do with the timing data + * + * @param count - Timer count in the units defined by the source + * @param src - Source of the timer data. In case multiple sources are enabled +*/ +void UsageTraceUserHook(uint32_t count, usage_src_t src); + +/** + * Inline function to be placed at the start of the code to be measured. + * Disables interrupts (if defined) and starts all defined timing mechanisms + */ +static inline void _UsageTraceStart(void) +{ +#ifdef USAGE_NO_IRQ + __disable_irq(); +#endif + +#ifdef USAGE_TMR + USAGE_TMR_INST->cnt = 0; +#endif + +#ifdef USAGE_GPIO_OUT + USAGE_GPIO_PORT->out_set = USAGE_GPIO_PIN; +#endif +} + +/** + * Inline function to be placed at the end of the code to be measured. + * Stops all defined timing mechanisms, calls the user hook (if necessary) and + * re-enables interrupts if they were disabled. + */ +static inline void _UsageTraceEnd(void) +{ +#ifdef USAGE_GPIO_OUT + USAGE_GPIO_PORT->out_clr = USAGE_GPIO_PIN; +#endif + +#ifdef USAGE_TMR + uint32_t countTmr; + countTmr = USAGE_TMR_INST->cnt; +#endif + +#ifdef USAGE_NO_IRQ + __enable_irq(); +#endif + +//Defer the user hook until after interrupts are enabled and all counts are +//gathered to not skew the timing, and let the user do what they want in the +//hook +#ifdef USAGE_TMR + UsageTraceUserHook(countTmr, USAGE_SRC_TMR); +#endif +} + +#endif //EXAMPLES_MAX32650_CLCD_FREERTOS_USAGETRACE_H_ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output.png b/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output.png new file mode 100644 index 00000000000..fa077213770 Binary files /dev/null and b/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output.png differ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output2.png b/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output2.png new file mode 100644 index 00000000000..3f2fbf9bbbf Binary files /dev/null and b/Examples/MAX32650/CLCD_FreeRTOS/doc/gpio_output2.png differ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/doc/xrtos.png b/Examples/MAX32650/CLCD_FreeRTOS/doc/xrtos.png new file mode 100644 index 00000000000..a4fb12c9781 Binary files /dev/null and b/Examples/MAX32650/CLCD_FreeRTOS/doc/xrtos.png differ diff --git a/Examples/MAX32650/CLCD_FreeRTOS/main.c b/Examples/MAX32650/CLCD_FreeRTOS/main.c new file mode 100644 index 00000000000..8ec6dc0f2d9 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/main.c @@ -0,0 +1,117 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#include +#include +#include + +#include "FreeRTOS.h" +#include "FreeRTOSConfig.h" +#include "portable.h" +#include "task.h" + +#include "mxc_device.h" +#include "mxc_sys.h" +#include "tmr.h" + +#include "LCD_Task.h" +#include "UsageTrace.h" + +/* Frequency to print the task information to the console */ +#define TASK_PRINT_PERIOD_MS 10000 + +/* Buffer for holding task information. + * FreeRTOS recommends 40 chars per task. Arbitrarily assume 20 tasks or less + */ +#define MAX_TASK_STATUS 20 +static char taskStatusBuf[MAX_TASK_STATUS * 40]; + +/* Background task handle */ +static TaskHandle_t backgroundTask; + +/* Local Prototypes */ +static void BackgroundTaskBody(void *pvParameters); + +/** + * Define a custom PreInit function to set the system clock to the full 120MHz + * overriding the default 60MHz. This is done here prior to the BSP getting + * initialized so the console baud rate and other features are correct + * + * See Libraries\CMSIS\Device\Maxim\MAX32650\Source\system_max32650.c + */ +int PreInit(void) +{ + /* Workaround: Write to SCON register on power up to fix trim issue for SRAM */ + MXC_GCR->scon = (MXC_GCR->scon & ~(MXC_F_GCR_SCON_OVR)) | (MXC_S_GCR_SCON_OVR_1V1); + + MXC_SYS_Clock_Select(MXC_SYS_CLOCK_HIRC96); + MXC_SYS_Clock_Div(MXC_SYS_SYSTEM_DIV_1); + return 0; +} + +/** + * Main entry point into our application. + */ +int main(void) +{ + /* Print banner (RTOS scheduler not running) */ + printf("\n-=- FreeRTOS (%s) Demo -=-\n", tskKERNEL_VERSION_NUMBER); + printf("SystemCoreClock = %d\n", SystemCoreClock); + + /* Initialize the trace helper */ + UsageTraceInit(); + + //Create the background task, which also initializes any other system tasks + xTaskCreate(BackgroundTaskBody, (const char *)"Background", 1024, NULL, tskIDLE_PRIORITY + 1, + &backgroundTask); + vTaskStartScheduler(); + + //Should never get here! + while (1) { + __NOP(); + } +} + +/** + * Hook for handling the timer trace calls. This application just prints to the + * terminal. + * @param count - Number of timer ticks + * @param src - Source of the timer data + */ +void UsageTraceUserHook(uint32_t count, usage_src_t src) +{ + printf("Usage: %d %d\n", count, src); +} + +/** + * Background task body. Initialize the other tasks at startup, then + * periodically print the FreeRTOS task statistics + */ +void BackgroundTaskBody(void *pvParameters) +{ + LCD_TaskInitialize(); + + while (1) { + //Periodically print the Task information + vTaskGetRunTimeStats(taskStatusBuf); + printf("====================\n"); + printf("Tick Count: %u\n", xTaskGetTickCount()); + printf("%s", taskStatusBuf); + printf("====================\n"); + vTaskDelay(TASK_PRINT_PERIOD_MS / portTICK_PERIOD_MS); + } +} diff --git a/Examples/MAX32650/CLCD_FreeRTOS/project.mk b/Examples/MAX32650/CLCD_FreeRTOS/project.mk new file mode 100644 index 00000000000..5d1239a8312 --- /dev/null +++ b/Examples/MAX32650/CLCD_FreeRTOS/project.mk @@ -0,0 +1,25 @@ +# This file can be used to set build configuration +# variables. These variables are defined in a file called +# "Makefile" that is located next to this one. + +# For instructions on how to use this system, see +# https://analogdevicesinc.github.io/msdk/USERGUIDE/#build-system + +#BOARD=FTHR_RevA +# ^ For example, you can uncomment this line to make the +# project build for the "FTHR_RevA" board. + +# ********************************************************** + +MXC_OPTIMIZE_CFLAGS += -Og + +PROJ_CFLAGS += -DUSAGE_GPIO_OUT -DUSAGE_TMR -DUSAGE_NO_IRQ +PROJ_CFLAGS += -DLCD_DISP_TASK_STATS -DLCD_DOUBLE_BUFFER + +# If you have secure version of MCU (MAX32651), set SBT=1 to generate signed binary +# For more information on how sing process works, see +# https://www.analog.com/en/education/education-library/videos/6313214207112.html +SBT=0 + +# Enable FreeRTOS library +LIB_FREERTOS=1