Test Makefile on Pi

This commit is contained in:
2024-11-19 21:50:22 -05:00
parent f580cac132
commit 2aca002000
29 changed files with 13311 additions and 81 deletions

580
.idea/editor.xml generated Normal file
View File

@@ -0,0 +1,580 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BackendCodeEditorSettings">
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
</component>
</project>

3
.idea/misc.xml generated
View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakePythonSetting">
<option name="pythonIntegrationState" value="YES" />
</component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/c">
<contentRoot DIR="$PROJECT_DIR$" />
</component>

View File

@@ -7,9 +7,10 @@ set(CMAKE_CXX_STANDARD 11)
include_directories(${CMAKE_SOURCE_DIR}/libs/include)
link_directories(${CMAKE_SOURCE_DIR}/libs)
add_library(p2fa SHARED p2fa.c)
add_library(p2fa SHARED src/p2fa.c
src/images.c)
target_link_libraries(p2fa SDL2 SDL2main)
target_link_libraries(p2fa)
set_target_properties(p2fa PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build"

522
c/libs/Config/DEV_Config.c Normal file
View File

@@ -0,0 +1,522 @@
/*****************************************************************************
* | File : DEV_Config.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
*----------------
* | This version: V3.0
* | Date : 2019-07-31
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of theex Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "DEV_Config.h"
#if USE_LGPIO_LIB
int GPIO_Handle;
int SPI_Handle;
#endif
/**
* GPIO
**/
int EPD_RST_PIN;
int EPD_DC_PIN;
int EPD_CS_PIN;
int EPD_BUSY_PIN;
int EPD_PWR_PIN;
int EPD_MOSI_PIN;
int EPD_SCLK_PIN;
/**
* GPIO read and write
**/
void DEV_Digital_Write(UWORD Pin, UBYTE Value)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
bcm2835_gpio_write(Pin, Value);
#elif USE_WIRINGPI_LIB
digitalWrite(Pin, Value);
#elif USE_LGPIO_LIB
lgGpioWrite(GPIO_Handle, Pin, Value);
#elif USE_DEV_LIB
GPIOD_Write(Pin, Value);
#endif
#endif
#ifdef JETSON
#ifdef USE_DEV_LIB
SYSFS_GPIO_Write(Pin, Value);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
}
UBYTE DEV_Digital_Read(UWORD Pin)
{
UBYTE Read_value = 0;
#ifdef RPI
#ifdef USE_BCM2835_LIB
Read_value = bcm2835_gpio_lev(Pin);
#elif USE_WIRINGPI_LIB
Read_value = digitalRead(Pin);
#elif USE_LGPIO_LIB
Read_value = lgGpioRead(GPIO_Handle,Pin);
#elif USE_DEV_LIB
Read_value = GPIOD_Read(Pin);
#endif
#endif
#ifdef JETSON
#ifdef USE_DEV_LIB
Read_value = SYSFS_GPIO_Read(Pin);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
return Read_value;
}
/**
* SPI
**/
void DEV_SPI_WriteByte(uint8_t Value)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
bcm2835_spi_transfer(Value);
#elif USE_WIRINGPI_LIB
wiringPiSPIDataRW(0,&Value,1);
#elif USE_LGPIO_LIB
lgSpiWrite(SPI_Handle,(char*)&Value, 1);
#elif USE_DEV_LIB
DEV_HARDWARE_SPI_TransferByte(Value);
#endif
#endif
#ifdef JETSON
#ifdef USE_DEV_LIB
SYSFS_software_spi_transfer(Value);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
}
void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
char rData[Len];
bcm2835_spi_transfernb((char *)pData,rData,Len);
#elif USE_WIRINGPI_LIB
wiringPiSPIDataRW(0, pData, Len);
#elif USE_LGPIO_LIB
lgSpiWrite(SPI_Handle,(char*)pData, Len);
#elif USE_DEV_LIB
DEV_HARDWARE_SPI_Transfer(pData, Len);
#endif
#endif
#ifdef JETSON
#ifdef USE_DEV_LIB
//JETSON nano waits for hardware SPI
// Debug("not support");
uint32_t i;
for(i = 0; i<Len; i++)
SYSFS_software_spi_transfer(pData[i]);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
}
/**
* GPIO Mode
**/
void DEV_GPIO_Mode(UWORD Pin, UWORD Mode)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
if(Mode == 0 || Mode == BCM2835_GPIO_FSEL_INPT) {
bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_INPT);
} else {
bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_OUTP);
}
#elif USE_WIRINGPI_LIB
if(Mode == 0 || Mode == INPUT) {
pinMode(Pin, INPUT);
pullUpDnControl(Pin, PUD_UP);
} else {
pinMode(Pin, OUTPUT);
// Debug (" %d OUT \r\n",Pin);
}
#elif USE_LGPIO_LIB
if(Mode == 0 || Mode == LG_SET_INPUT){
lgGpioClaimInput(GPIO_Handle,LFLAGS,Pin);
// printf("IN Pin = %d\r\n",Pin);
}else{
lgGpioClaimOutput(GPIO_Handle, LFLAGS, Pin, LG_LOW);
// printf("OUT Pin = %d\r\n",Pin);
}
#elif USE_DEV_LIB
if(Mode == 0 || Mode == GPIOD_IN) {
GPIOD_Direction(Pin, GPIOD_IN);
// Debug("IN Pin = %d\r\n",Pin);
} else {
GPIOD_Direction(Pin, GPIOD_OUT);
// Debug("OUT Pin = %d\r\n",Pin);
}
#endif
#endif
#ifdef JETSON
#ifdef USE_DEV_LIB
SYSFS_GPIO_Export(Pin);
SYSFS_GPIO_Direction(Pin, Mode);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
}
/**
* delay x ms
**/
void DEV_Delay_ms(UDOUBLE xms)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
bcm2835_delay(xms);
#elif USE_WIRINGPI_LIB
delay(xms);
#elif USE_LGPIO_LIB
lguSleep(xms/1000.0);
#elif USE_DEV_LIB
UDOUBLE i;
for(i=0; i < xms; i++) {
usleep(1000);
}
#endif
#endif
#ifdef JETSON
UDOUBLE i;
for(i=0; i < xms; i++) {
usleep(1000);
}
#endif
}
static int DEV_Equipment_Testing(void)
{
FILE *fp;
char issue_str[64];
fp = fopen("/etc/issue", "r");
if (fp == NULL) {
Debug("Unable to open /etc/issue");
return -1;
}
if (fread(issue_str, 1, sizeof(issue_str), fp) <= 0) {
Debug("Unable to read from /etc/issue");
return -1;
}
issue_str[sizeof(issue_str)-1] = '\0';
fclose(fp);
printf("Current environment: ");
#ifdef RPI
char systems[][9] = {"Raspbian", "Debian", "NixOS"};
int detected = 0;
for(int i=0; i<3; i++) {
if (strstr(issue_str, systems[i]) != NULL) {
printf("%s\n", systems[i]);
detected = 1;
}
}
if (!detected) {
printf("not recognized\n");
printf("Built for Raspberry Pi, but unable to detect environment.\n");
printf("Perhaps you meant to 'make JETSON' instead?\n");
return -1;
}
#endif
#ifdef JETSON
char system[] = {"Ubuntu"};
if (strstr(issue_str, system) != NULL) {
printf("%s\n", system);
} else {
printf("not recognized\n");
printf("Built for Jetson, but unable to detect environment.\n");
printf("Perhaps you meant to 'make RPI' instead?\n");
return -1;
}
#endif
return 0;
}
void DEV_GPIO_Init(void)
{
#ifdef RPI
EPD_RST_PIN = 17;
EPD_DC_PIN = 25;
EPD_CS_PIN = 8;
EPD_PWR_PIN = 18;
EPD_BUSY_PIN = 24;
EPD_MOSI_PIN = 10;
EPD_SCLK_PIN = 11;
#elif JETSON
EPD_RST_PIN = GPIO17;
EPD_DC_PIN = GPIO25;
EPD_CS_PIN = SPI0_CS0;
EPD_PWR_PIN = GPIO18;
EPD_BUSY_PIN = GPIO24;
EPD_MOSI_PIN = SPI0_MOSI;
EPD_SCLK_PIN = SPI0_SCLK;
#endif
DEV_GPIO_Mode(EPD_BUSY_PIN, 0);
DEV_GPIO_Mode(EPD_RST_PIN, 1);
DEV_GPIO_Mode(EPD_DC_PIN, 1);
DEV_GPIO_Mode(EPD_CS_PIN, 1);
DEV_GPIO_Mode(EPD_PWR_PIN, 1);
// DEV_GPIO_Mode(EPD_MOSI_PIN, 0);
// DEV_GPIO_Mode(EPD_SCLK_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 1);
DEV_Digital_Write(EPD_PWR_PIN, 1);
}
void DEV_SPI_SendnData(UBYTE *Reg)
{
UDOUBLE size;
size = sizeof(Reg);
for(UDOUBLE i=0 ; i<size ; i++)
{
DEV_SPI_SendData(Reg[i]);
}
}
void DEV_SPI_SendData(UBYTE Reg)
{
UBYTE i,j=Reg;
DEV_GPIO_Mode(EPD_MOSI_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for(i = 0; i<8; i++)
{
DEV_Digital_Write(EPD_SCLK_PIN, 0);
if (j & 0x80)
{
DEV_Digital_Write(EPD_MOSI_PIN, 1);
}
else
{
DEV_Digital_Write(EPD_MOSI_PIN, 0);
}
DEV_Digital_Write(EPD_SCLK_PIN, 1);
j = j << 1;
}
DEV_Digital_Write(EPD_SCLK_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
UBYTE DEV_SPI_ReadData()
{
UBYTE i,j=0xff;
DEV_GPIO_Mode(EPD_MOSI_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
for(i = 0; i<8; i++)
{
DEV_Digital_Write(EPD_SCLK_PIN, 0);
j = j << 1;
if (DEV_Digital_Read(EPD_MOSI_PIN))
{
j = j | 0x01;
}
else
{
j= j & 0xfe;
}
DEV_Digital_Write(EPD_SCLK_PIN, 1);
}
DEV_Digital_Write(EPD_SCLK_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 1);
return j;
}
/******************************************************************************
function: Module Initialize, the library and initialize the pins, SPI protocol
parameter:
Info:
******************************************************************************/
UBYTE DEV_Module_Init(void)
{
printf("/***********************************/ \r\n");
if(DEV_Equipment_Testing() < 0) {
return 1;
}
#ifdef RPI
#ifdef USE_BCM2835_LIB
if(!bcm2835_init()) {
printf("bcm2835 init failed !!! \r\n");
return 1;
} else {
printf("bcm2835 init success !!! \r\n");
}
// GPIO Config
DEV_GPIO_Init();
bcm2835_spi_begin(); //Start spi interface, set spi pin for the reuse function
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST); //High first transmission
bcm2835_spi_setDataMode(BCM2835_SPI_MODE0); //spi mode 0
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128); //Frequency
bcm2835_spi_chipSelect(BCM2835_SPI_CS0); //set CE0
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW); //enable cs0
#elif USE_WIRINGPI_LIB
//if(wiringPiSetup() < 0)//use wiringpi Pin number table
if(wiringPiSetupGpio() < 0) { //use BCM2835 Pin number table
printf("set wiringPi lib failed !!! \r\n");
return 1;
} else {
printf("set wiringPi lib success !!! \r\n");
}
// GPIO Config
DEV_GPIO_Init();
wiringPiSPISetup(0,10000000);
// wiringPiSPISetupMode(0, 32000000, 0);
#elif USE_LGPIO_LIB
char buffer[NUM_MAXBUF];
FILE *fp;
fp = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r");
if (fp == NULL) {
Debug("It is not possible to determine the model of the Raspberry PI\n");
return -1;
}
if(fgets(buffer, sizeof(buffer), fp) != NULL)
{
GPIO_Handle = lgGpiochipOpen(4);
if (GPIO_Handle < 0)
{
Debug( "gpiochip4 Export Failed\n");
return -1;
}
}
else
{
GPIO_Handle = lgGpiochipOpen(0);
if (GPIO_Handle < 0)
{
Debug( "gpiochip0 Export Failed\n");
return -1;
}
}
SPI_Handle = lgSpiOpen(0, 0, 10000000, 0);
DEV_GPIO_Init();
#elif USE_DEV_LIB
printf("Write and read /dev/spidev0.0 \r\n");
GPIOD_Export();
DEV_GPIO_Init();
DEV_HARDWARE_SPI_begin("/dev/spidev0.0");
DEV_HARDWARE_SPI_setSpeed(10000000);
#endif
#elif JETSON
#ifdef USE_DEV_LIB
DEV_GPIO_Init();
printf("Software spi\r\n");
SYSFS_software_spi_begin();
SYSFS_software_spi_setBitOrder(SOFTWARE_SPI_MSBFIRST);
SYSFS_software_spi_setDataMode(SOFTWARE_SPI_Mode0);
SYSFS_software_spi_setClockDivider(SOFTWARE_SPI_CLOCK_DIV4);
#elif USE_HARDWARE_LIB
printf("Write and read /dev/spidev0.0 \r\n");
DEV_GPIO_Init();
DEV_HARDWARE_SPI_begin("/dev/spidev0.0");
#endif
#endif
printf("/***********************************/ \r\n");
return 0;
}
/******************************************************************************
function: Module exits, closes SPI and BCM2835 library
parameter:
Info:
******************************************************************************/
void DEV_Module_Exit(void)
{
#ifdef RPI
#ifdef USE_BCM2835_LIB
DEV_Digital_Write(EPD_CS_PIN, LOW);
DEV_Digital_Write(EPD_PWR_PIN, LOW);
DEV_Digital_Write(EPD_DC_PIN, LOW);
DEV_Digital_Write(EPD_RST_PIN, LOW);
bcm2835_spi_end();
bcm2835_close();
#elif USE_WIRINGPI_LIB
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_Digital_Write(EPD_PWR_PIN, 0);
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_RST_PIN, 0);
#elif USE_LGPIO_LIB
// DEV_Digital_Write(EPD_CS_PIN, 0);
// DEV_Digital_Write(EPD_PWR_PIN, 0);
// DEV_Digital_Write(EPD_DC_PIN, 0);
// DEV_Digital_Write(EPD_RST_PIN, 0);
// lgSpiClose(SPI_Handle);
// lgGpiochipClose(GPIO_Handle);
#elif USE_DEV_LIB
DEV_HARDWARE_SPI_end();
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_Digital_Write(EPD_PWR_PIN, 0);
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_RST_PIN, 0);
GPIOD_Unexport(EPD_PWR_PIN);
GPIOD_Unexport(EPD_DC_PIN);
GPIOD_Unexport(EPD_RST_PIN);
GPIOD_Unexport(EPD_BUSY_PIN);
GPIOD_Unexport_GPIO();
#endif
#elif JETSON
#ifdef USE_DEV_LIB
SYSFS_GPIO_Unexport(EPD_CS_PIN);
SYSFS_GPIO_Unexport(EPD_PWR_PIN;
SYSFS_GPIO_Unexport(EPD_DC_PIN);
SYSFS_GPIO_Unexport(EPD_RST_PIN);
SYSFS_GPIO_Unexport(EPD_BUSY_PIN);
#elif USE_HARDWARE_LIB
Debug("not support");
#endif
#endif
}

170
c/libs/Config/RPI_gpiod.c Normal file
View File

@@ -0,0 +1,170 @@
/*****************************************************************************
* | File : RPI_GPIOD.c
* | Author : Waveshare team
* | Function : Drive GPIO
* | Info : Read and write gpio
*----------------
* | This version: V1.0
* | Date : 2023-11-15
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# GPIOD_IN the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the folGPIOD_LOWing conditions:
#
# The above copyright notice and this permission notice shall be included GPIOD_IN
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. GPIOD_IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER GPIOD_IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# GPIOD_OUT OF OR GPIOD_IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS GPIOD_IN
# THE SOFTWARE.
#
******************************************************************************/
#include "RPI_gpiod.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <gpiod.h>
struct gpiod_chip *gpiochip;
struct gpiod_line *gpioline;
int ret;
int GPIOD_Export()
{
char buffer[NUM_MAXBUF];
FILE *fp;
fp = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r");
if (fp == NULL) {
GPIOD_Debug("It is not possible to determine the model of the Raspberry PI\n");
return -1;
}
if(fgets(buffer, sizeof(buffer), fp) != NULL)
{
gpiochip = gpiod_chip_open("/dev/gpiochip4");
if (gpiochip == NULL)
{
GPIOD_Debug( "gpiochip4 Export Failed\n");
return -1;
}
}
else
{
gpiochip = gpiod_chip_open("/dev/gpiochip0");
if (gpiochip == NULL)
{
GPIOD_Debug( "gpiochip0 Export Failed\n");
return -1;
}
}
return 0;
}
int GPIOD_Unexport(int Pin)
{
gpioline = gpiod_chip_get_line(gpiochip, Pin);
if (gpioline == NULL)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
gpiod_line_release(gpioline);
GPIOD_Debug( "Unexport: Pin%d\r\n", Pin);
return 0;
}
int GPIOD_Unexport_GPIO(void)
{
gpiod_line_release(gpioline);
gpiod_chip_close(gpiochip);
return 0;
}
int GPIOD_Direction(int Pin, int Dir)
{
gpioline = gpiod_chip_get_line(gpiochip, Pin);
if (gpioline == NULL)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
if(Dir == GPIOD_IN)
{
ret = gpiod_line_request_input(gpioline, "gpio");
if (ret != 0)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
GPIOD_Debug("Pin%d:intput\r\n", Pin);
}
else
{
ret = gpiod_line_request_output(gpioline, "gpio", 0);
if (ret != 0)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
GPIOD_Debug("Pin%d:Output\r\n", Pin);
}
return 0;
}
int GPIOD_Read(int Pin)
{
gpioline = gpiod_chip_get_line(gpiochip, Pin);
if (gpioline == NULL)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
ret = gpiod_line_get_value(gpioline);
if (ret < 0)
{
GPIOD_Debug( "failed to read value!\n");
return -1;
}
return(ret);
}
int GPIOD_Write(int Pin, int value)
{
gpioline = gpiod_chip_get_line(gpiochip, Pin);
if (gpioline == NULL)
{
GPIOD_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
ret = gpiod_line_set_value(gpioline, value);
if (ret != 0)
{
GPIOD_Debug( "failed to write value! : Pin%d\n", Pin);
return -1;
}
return 0;
}

88
c/libs/Config/RPI_gpiod.h Normal file
View File

@@ -0,0 +1,88 @@
/*****************************************************************************
* | File : gpiod.h
* | Author : Waveshare team
* | Function : Drive GPIO
* | Info : Read and write gpio
*----------------
* | This version: V1.0
* | Date : 2023-11-15
* | Info : Basic version
*d
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#D
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
************************D******************************************************/
#ifndef __GPIOD_
#define __GPIOD_
#include <stdio.h>
#include <gpiod.h>
#define GPIOD_IN 0
#define GPIOD_OUT 1
#define GPIOD_LOW 0
#define GPIOD_HIGH 1
#define NUM_MAXBUF 4
#define DIR_MAXSIZ 60
#define GPIOD_DEBUG 0
#if GPIOD_DEBUG
#define GPIOD_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define GPIOD_Debug(__info,...)
#endif
// BCM GPIO for Jetson nano
#define GPIO4 4 // 7, 4
#define GPIO17 7 // 11, 17
#define GPIO18 18 // 12, 18
#define GPIO27 27 // 13, 27
#define GPIO22 22 // 15, 22
#define GPIO23 23 // 16, 23
#define GPIO24 24 // 18, 24
#define SPI0_MOSI 10 // 19, 10
#define SPI0_MISO 9 // 21, 9
#define GPIO25 28 // 22, 25
#define SPI0_SCK 11 // 23, 11
#define SPI0_CS0 8 // 24, 8
#define SPI0_CS1 7 // 26, 7
#define GPIO5 5 // 29, 5
#define GPIO6 6 // 31, 6
#define GPIO12 12 // 32, 12
#define GPIO13 13 // 33, 13
#define GPIO19 19 // 35, 19
#define GPIO16 16 // 36, 16
#define GPIO26 26 // 37, 26
#define GPIO20 20 // 38, 20
#define GPIO21 21 // 40, 21
extern struct gpiod_chip *gpiochip;
extern struct gpiod_line *gpioline;
extern int ret;
int GPIOD_Export();
int GPIOD_Unexport(int Pin);
int GPIOD_Unexport_GPIO(void);
int GPIOD_Direction(int Pin, int Dir);
int GPIOD_Read(int Pin);
int GPIOD_Write(int Pin, int value);
#endif

View File

@@ -0,0 +1,366 @@
/*****************************************************************************
* | File : dev_hardware_SPI.c
* | Author : Waveshare team
* | Function : Read and write /dev/SPI, hardware SPI
* | Info :
*----------------
* | This version: V1.0
* | Date : 2019-06-26
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "dev_hardware_SPI.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
HARDWARE_SPI hardware_SPI;
static uint8_t bits = 8;
#define SPI_CS_HIGH 0x04 //Chip select high
#define SPI_LSB_FIRST 0x08 //LSB
#define SPI_3WIRE 0x10 //3-wire mode SI and SO same line
#define SPI_LOOP 0x20 //Loopback mode
#define SPI_NO_CS 0x40 //A single device occupies one SPI bus, so there is no chip select
#define SPI_READY 0x80 //Slave pull low to stop data transmission
struct spi_ioc_transfer tr;
/******************************************************************************
function: SPI port initialization
parameter:
SPI_device : Device name
Info:
/dev/spidev0.0
/dev/spidev0.1
******************************************************************************/
void DEV_HARDWARE_SPI_begin(char *SPI_device)
{
//device
int ret = 0;
if((hardware_SPI.fd = open(SPI_device, O_RDWR )) < 0) {
perror("Failed to open SPI device.\n");
printf("Failed to open SPI device\r\n");
DEV_HARDWARE_SPI_Debug("Failed to open SPI device\r\n");
exit(1);
} else {
printf("open : %s\r\n", SPI_device);
DEV_HARDWARE_SPI_Debug("open : %s\r\n", SPI_device);
}
hardware_SPI.mode = 0;
ret = ioctl(hardware_SPI.fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (ret == -1) {
printf("can't set bits per word\r\n");
DEV_HARDWARE_SPI_Debug("can't set bits per word\r\n");
}
ret = ioctl(hardware_SPI.fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
if (ret == -1) {
printf("can't get bits per word\r\n");
DEV_HARDWARE_SPI_Debug("can't get bits per word\r\n");
}
tr.bits_per_word = bits;
DEV_HARDWARE_SPI_Mode(SPI_MODE_0);
DEV_HARDWARE_SPI_ChipSelect(SPI_CS_Mode_LOW);
DEV_HARDWARE_SPI_SetBitOrder(SPI_BIT_ORDER_LSBFIRST);
DEV_HARDWARE_SPI_setSpeed(20000000);
DEV_HARDWARE_SPI_SetDataInterval(5);
}
void DEV_HARDWARE_SPI_beginSet(char *SPI_device, SPIMode mode, uint32_t speed)
{
//device
int ret = 0;
hardware_SPI.mode = 0;
if((hardware_SPI.fd = open(SPI_device, O_RDWR )) < 0) {
perror("Failed to open SPI device.\n");
exit(1);
} else {
DEV_HARDWARE_SPI_Debug("open : %s\r\n", SPI_device);
}
ret = ioctl(hardware_SPI.fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (ret == -1)
DEV_HARDWARE_SPI_Debug("can't set bits per word\r\n");
ret = ioctl(hardware_SPI.fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
if (ret == -1)
DEV_HARDWARE_SPI_Debug("can't get bits per word\r\n");
DEV_HARDWARE_SPI_Mode(mode);
DEV_HARDWARE_SPI_ChipSelect(SPI_CS_Mode_LOW);
DEV_HARDWARE_SPI_setSpeed(speed);
DEV_HARDWARE_SPI_SetDataInterval(0);
}
/******************************************************************************
function: SPI device End
parameter:
Info:
******************************************************************************/
void DEV_HARDWARE_SPI_end(void)
{
hardware_SPI.mode = 0;
if (close(hardware_SPI.fd) != 0){
DEV_HARDWARE_SPI_Debug("Failed to close SPI device\r\n");
perror("Failed to close SPI device.\n");
}
}
/******************************************************************************
function: Set SPI speed
parameter:
Info: Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_setSpeed(uint32_t speed)
{
uint32_t speed1 = hardware_SPI.speed;
hardware_SPI.speed = speed;
//Write speed
if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed) == -1) {
DEV_HARDWARE_SPI_Debug("can't set max speed hz\r\n");
hardware_SPI.speed = speed1;//Setting failure rate unchanged
return -1;
}
//Read the speed of just writing
if (ioctl(hardware_SPI.fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) == -1) {
DEV_HARDWARE_SPI_Debug("can't get max speed hz\r\n");
hardware_SPI.speed = speed1;//Setting failure rate unchanged
return -1;
}
hardware_SPI.speed = speed;
tr.speed_hz = hardware_SPI.speed;
return 1;
}
/******************************************************************************
function: Set SPI Mode
parameter:
Info:
SPIMode:
SPI_MODE0
SPI_MODE1
SPI_MODE2
SPI_MODE3
Return :
Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_Mode(SPIMode mode)
{
hardware_SPI.mode &= 0xfC;//Clear low 2 digits
hardware_SPI.mode |= mode;//Setting mode
//Write device
if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) {
DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n");
return -1;
}
return 1;
}
/******************************************************************************
function: Set SPI CS Enable
parameter:
Info:
EN:
DISABLE
ENABLE
Return :
Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_CSEN(SPICSEN EN)
{
if(EN == ENABLE){
hardware_SPI.mode |= SPI_NO_CS;
}else {
hardware_SPI.mode &= ~SPI_NO_CS;
}
//Write device
if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) {
DEV_HARDWARE_SPI_Debug("can't set spi CS EN\r\n");
return -1;
}
return 1;
}
/******************************************************************************
function: Chip Select
parameter:
Info:
CS_Mode:
SPI_CS_Mode_LOW
SPI_CS_Mode_HIGH
SPI_CS_Mode_NONE
Return :
Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_ChipSelect(SPIChipSelect CS_Mode)
{
if(CS_Mode == SPI_CS_Mode_HIGH){
hardware_SPI.mode |= SPI_CS_HIGH;
hardware_SPI.mode &= ~SPI_NO_CS;
DEV_HARDWARE_SPI_Debug("CS HIGH \r\n");
}else if(CS_Mode == SPI_CS_Mode_LOW){
hardware_SPI.mode &= ~SPI_CS_HIGH;
hardware_SPI.mode &= ~SPI_NO_CS;
}else if(CS_Mode == SPI_CS_Mode_NONE){
hardware_SPI.mode |= SPI_NO_CS;
}
if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) {
DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n");
return -1;
}
return 1;
}
/******************************************************************************
function: Sets the SPI bit order
parameter:
Info:
Order:
SPI_BIT_ORDER_LSBFIRST
SPI_BIT_ORDER_MSBFIRST
Return :
Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_SetBitOrder(SPIBitOrder Order)
{
if(Order == SPI_BIT_ORDER_LSBFIRST){
hardware_SPI.mode |= SPI_LSB_FIRST;
DEV_HARDWARE_SPI_Debug("SPI_LSB_FIRST\r\n");
}else if(Order == SPI_BIT_ORDER_MSBFIRST){
hardware_SPI.mode &= ~SPI_LSB_FIRST;
DEV_HARDWARE_SPI_Debug("SPI_MSB_FIRST\r\n");
}
// DEV_HARDWARE_SPI_Debug("hardware_SPI.mode = 0x%02x\r\n", hardware_SPI.mode);
int fd = ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode);
DEV_HARDWARE_SPI_Debug("fd = %d\r\n",fd);
if (fd == -1) {
DEV_HARDWARE_SPI_Debug("can't set spi SPI_LSB_FIRST\r\n");
return -1;
}
return 1;
}
/******************************************************************************
function: Sets the SPI Bus Mode
parameter:
Info:
Order:
SPI_3WIRE_Mode
SPI_4WIRE_Mode
Return :
Return 1 success
Return -1 failed
******************************************************************************/
int DEV_HARDWARE_SPI_SetBusMode(BusMode mode)
{
if(mode == SPI_3WIRE_Mode){
hardware_SPI.mode |= SPI_3WIRE;
}else if(mode == SPI_4WIRE_Mode){
hardware_SPI.mode &= ~SPI_3WIRE;
}
if (ioctl(hardware_SPI.fd, SPI_IOC_WR_MODE, &hardware_SPI.mode) == -1) {
DEV_HARDWARE_SPI_Debug("can't set spi mode\r\n");
return -1;
}
return 1;
}
/******************************************************************************
function:
Time interval after transmission of one byte during continuous transmission
parameter:
us : Interval time (us)
Info:
******************************************************************************/
void DEV_HARDWARE_SPI_SetDataInterval(uint16_t us)
{
hardware_SPI.delay = us;
tr.delay_usecs = hardware_SPI.delay;
}
/******************************************************************************
function: SPI port sends one byte of data
parameter:
buf : Sent data
Info:
******************************************************************************/
uint8_t DEV_HARDWARE_SPI_TransferByte(uint8_t buf)
{
uint8_t rbuf[1];
tr.len = 1;
tr.tx_buf = (unsigned long)&buf;
tr.rx_buf = (unsigned long)rbuf;
//ioctl Operation, transmission of data
if ( ioctl(hardware_SPI.fd, SPI_IOC_MESSAGE(1), &tr) < 1 )
DEV_HARDWARE_SPI_Debug("can't send spi message\r\n");
return rbuf[0];
}
/******************************************************************************
function: The SPI port reads a byte
parameter:
Info: Return read data
******************************************************************************/
int DEV_HARDWARE_SPI_Transfer(uint8_t *buf, uint32_t len)
{
tr.len = len;
tr.tx_buf = (unsigned long)buf;
tr.rx_buf = (unsigned long)buf;
//ioctl Operation, transmission of data
if (ioctl(hardware_SPI.fd, SPI_IOC_MESSAGE(1), &tr) < 1 ){
DEV_HARDWARE_SPI_Debug("can't send spi message\r\n");
return -1;
}
return 1;
}

View File

@@ -0,0 +1,120 @@
/*****************************************************************************
* | File : dev_hardware_SPI.h
* | Author : Waveshare team
* | Function : Read and write /dev/SPI, hardware SPI
* | Info :
*----------------
* | This version: V1.0
* | Date : 2019-06-26
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef __DEV_HARDWARE_SPI_
#define __DEV_HARDWARE_SPI_
#include <stdint.h>
#define DEV_HARDWARE_SPI_DEBUG 0
#if DEV_HARDWARE_SPI_DEBUG
#define DEV_HARDWARE_SPI_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define DEV_HARDWARE_SPI_Debug(__info,...)
#endif
#define SPI_CPHA 0x01
#define SPI_CPOL 0x02
#define SPI_MODE_0 (0|0)
#define SPI_MODE_1 (0|SPI_CPHA)
#define SPI_MODE_2 (SPI_CPOL|0)
#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
typedef enum{
SPI_MODE0 = SPI_MODE_0, /*!< CPOL = 0, CPHA = 0 */
SPI_MODE1 = SPI_MODE_1, /*!< CPOL = 0, CPHA = 1 */
SPI_MODE2 = SPI_MODE_2, /*!< CPOL = 1, CPHA = 0 */
SPI_MODE3 = SPI_MODE_3 /*!< CPOL = 1, CPHA = 1 */
}SPIMode;
typedef enum{
DISABLE = 0,
ENABLE = 1
}SPICSEN;
typedef enum{
SPI_CS_Mode_LOW = 0, /*!< Chip Select 0 */
SPI_CS_Mode_HIGH = 1, /*!< Chip Select 1 */
SPI_CS_Mode_NONE = 3 /*!< No CS, control it yourself */
}SPIChipSelect;
typedef enum
{
SPI_BIT_ORDER_LSBFIRST = 0, /*!< LSB First */
SPI_BIT_ORDER_MSBFIRST = 1 /*!< MSB First */
}SPIBitOrder;
typedef enum
{
SPI_3WIRE_Mode = 0,
SPI_4WIRE_Mode = 1
}BusMode;
/**
* Define SPI attribute
**/
typedef struct SPIStruct {
//GPIO
uint16_t SCLK_PIN;
uint16_t MOSI_PIN;
uint16_t MISO_PIN;
uint16_t CS0_PIN;
uint16_t CS1_PIN;
uint32_t speed;
uint16_t mode;
uint16_t delay;
int fd; //
} HARDWARE_SPI;
void DEV_HARDWARE_SPI_begin(char *SPI_device);
void DEV_HARDWARE_SPI_beginSet(char *SPI_device, SPIMode mode, uint32_t speed);
void DEV_HARDWARE_SPI_end(void);
int DEV_HARDWARE_SPI_setSpeed(uint32_t speed);
uint8_t DEV_HARDWARE_SPI_TransferByte(uint8_t buf);
int DEV_HARDWARE_SPI_Transfer(uint8_t *buf, uint32_t len);
void DEV_HARDWARE_SPI_SetDataInterval(uint16_t us);
int DEV_HARDWARE_SPI_SetBusMode(BusMode mode);
int DEV_HARDWARE_SPI_SetBitOrder(SPIBitOrder Order);
int DEV_HARDWARE_SPI_ChipSelect(SPIChipSelect CS_Mode);
int DEV_HARDWARE_SPI_CSEN(SPICSEN EN);
int DEV_HARDWARE_SPI_Mode(SPIMode mode);
#endif

152
c/libs/Config/sysfs_gpio.c Normal file
View File

@@ -0,0 +1,152 @@
/*****************************************************************************
* | File : SYSFS_GPIO.c
* | Author : Waveshare team
* | Function : Drive SYSFS_ GPIO
* | Info : Read and write /sys/class/gpio
*----------------
* | This version: V1.0
* | Date : 2019-06-04
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "sysfs_gpio.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int SYSFS_GPIO_Export(int Pin)
{
char buffer[NUM_MAXBUF];
int len;
int fd;
fd = open("/sys/class/gpio/export", O_WRONLY);
if (fd < 0) {
SYSFS_GPIO_Debug( "Export Failed: Pin%d\n", Pin);
return -1;
}
len = snprintf(buffer, NUM_MAXBUF, "%d", Pin);
write(fd, buffer, len);
SYSFS_GPIO_Debug( "Export: Pin%d\r\n", Pin);
close(fd);
return 0;
}
int SYSFS_GPIO_Unexport(int Pin)
{
char buffer[NUM_MAXBUF];
int len;
int fd;
fd = open("/sys/class/gpio/unexport", O_WRONLY);
if (fd < 0) {
SYSFS_GPIO_Debug( "unexport Failed: Pin%d\n", Pin);
return -1;
}
len = snprintf(buffer, NUM_MAXBUF, "%d", Pin);
write(fd, buffer, len);
SYSFS_GPIO_Debug( "Unexport: Pin%d\r\n", Pin);
close(fd);
return 0;
}
int SYSFS_GPIO_Direction(int Pin, int Dir)
{
const char dir_str[] = "in\0out";
char path[DIR_MAXSIZ];
int fd;
snprintf(path, DIR_MAXSIZ, "/sys/class/gpio/gpio%d/direction", Pin);
fd = open(path, O_WRONLY);
if (fd < 0) {
SYSFS_GPIO_Debug( "Set Direction failed: Pin%d\n", Pin);
return -1;
}
if (write(fd, &dir_str[Dir == IN ? 0 : 3], Dir == IN ? 2 : 3) < 0) {
SYSFS_GPIO_Debug("failed to set direction!\r\n");
return -1;
}
if(Dir == IN){
SYSFS_GPIO_Debug("Pin%d:intput\r\n", Pin);
}else{
SYSFS_GPIO_Debug("Pin%d:Output\r\n", Pin);
}
close(fd);
return 0;
}
int SYSFS_GPIO_Read(int Pin)
{
char path[DIR_MAXSIZ];
char value_str[3];
int fd;
snprintf(path, DIR_MAXSIZ, "/sys/class/gpio/gpio%d/value", Pin);
fd = open(path, O_RDONLY);
if (fd < 0) {
SYSFS_GPIO_Debug( "Read failed Pin%d\n", Pin);
return -1;
}
if (read(fd, value_str, 3) < 0) {
SYSFS_GPIO_Debug( "failed to read value!\n");
return -1;
}
close(fd);
return(atoi(value_str));
}
int SYSFS_GPIO_Write(int Pin, int value)
{
const char s_values_str[] = "01";
char path[DIR_MAXSIZ];
int fd;
snprintf(path, DIR_MAXSIZ, "/sys/class/gpio/gpio%d/value", Pin);
fd = open(path, O_WRONLY);
if (fd < 0) {
SYSFS_GPIO_Debug( "Write failed : Pin%d,value = %d\n", Pin, value);
return -1;
}
if (write(fd, &s_values_str[value == LOW ? 0 : 1], 1) < 0) {
SYSFS_GPIO_Debug( "failed to write value!\n");
return -1;
}
close(fd);
return 0;
}

View File

@@ -0,0 +1,84 @@
/*****************************************************************************
* | File : sysfs_gpio.h
* | Author : Waveshare team
* | Function : Drive SC16IS752 GPIO
* | Info : Read and write /sys/class/gpio
*----------------
* | This version: V1.0
* | Date : 2019-06-04
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef __SYSFS_GPIO_
#define __SYSFS_GPIO_
#include <stdio.h>
#define IN 0
#define OUT 1
#define LOW 0
#define HIGH 1
#define NUM_MAXBUF 4
#define DIR_MAXSIZ 60
#define SYSFS_GPIO_DEBUG 1
#if SYSFS_GPIO_DEBUG
#define SYSFS_GPIO_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define SYSFS_GPIO_Debug(__info,...)
#endif
// BCM GPIO for Jetson nano
#define GPIO4 216 // 7, 4
#define GPIO17 50 // 11, 17
#define GPIO18 79 // 12, 18
#define GPIO27 14 // 13, 27
#define GPIO22 194 // 15, 22
#define GPIO23 232 // 16, 23
#define GPIO24 15 // 18, 24
#define SPI0_MOSI 16 // 19, 10
#define SPI0_MISO 17 // 21, 9
#define GPIO25 13 // 22, 25
#define SPI0_SCK 18 // 23, 11
#define SPI0_CS0 19 // 24, 8
#define SPI0_CS1 20 // 26, 7
#define GPIO5 149 // 29, 5
#define GPIO6 200 // 31, 6
#define GPIO12 168 // 32, 12
#define GPIO13 38 // 33, 13
#define GPIO19 76 // 35, 19
#define GPIO16 51 // 36, 16
#define GPIO26 12 // 37, 26
#define GPIO20 77 // 38, 20
#define GPIO21 78 // 40, 21
// 22PIN + 2PIN UART0 + 2PIN I2C0 + 2PIN I2C
// + 2PIN 3V3 + 2PIN 5V + 8PIN GND = 40PIN
int SYSFS_GPIO_Export(int Pin);
int SYSFS_GPIO_Unexport(int Pin);
int SYSFS_GPIO_Direction(int Pin, int Dir);
int SYSFS_GPIO_Read(int Pin);
int SYSFS_GPIO_Write(int Pin, int value);
#endif

View File

@@ -0,0 +1,204 @@
/*****************************************************************************
* | File : sysfs_software_spi.h
* | Author : Waveshare team
* | Function : Read and write /sys/class/gpio, software spi
* | Info :
*----------------
* | This version: V1.0
* | Date : 2019-06-05
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# Read_data OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "sysfs_software_spi.h"
SOFTWARE_SPI software_spi;
/******************************************************************************
function:
parameter:
Info:
******************************************************************************/
void SYSFS_software_spi_begin(void)
{
// gpio
software_spi.SCLK_PIN = SPI0_SCK;
software_spi.MOSI_PIN = SPI0_MOSI;
software_spi.MISO_PIN = SPI0_MISO;
//software spi configure
software_spi.Mode = SOFTWARE_SPI_Mode0;
software_spi.Type = SOFTWARE_SPI_Master;
software_spi.Delay = SOFTWARE_SPI_CLOCK_DIV2;
software_spi.Order = SOFTWARE_SPI_MSBFIRST; // MSBFIRST
SYSFS_GPIO_Export(software_spi.SCLK_PIN);
SYSFS_GPIO_Export(software_spi.MOSI_PIN);
SYSFS_GPIO_Export(software_spi.MISO_PIN);
SYSFS_GPIO_Direction(software_spi.SCLK_PIN, OUT);
SYSFS_GPIO_Direction(software_spi.MOSI_PIN, OUT);
SYSFS_GPIO_Direction(software_spi.MISO_PIN, IN);
}
void SYSFS_software_spi_end(void)
{
SYSFS_GPIO_Write(software_spi.SCLK_PIN, LOW);
SYSFS_GPIO_Write(software_spi.MOSI_PIN, LOW);
SYSFS_GPIO_Unexport(software_spi.SCLK_PIN);
SYSFS_GPIO_Unexport(software_spi.MOSI_PIN);
}
void SYSFS_software_spi_setBitOrder(uint8_t order)
{
software_spi.Order = order & 1;
}
void SYSFS_software_spi_setDataMode(uint8_t mode)
{
if(mode > 4) {
SYSFS_SOFTWARE_SPI_Debug("MODE must be 0-3\r\n");
return;
}
software_spi.Mode = mode;
switch (software_spi.Mode) {
case SOFTWARE_SPI_Mode0:
software_spi.CPOL = 0;
software_spi.CPHA = 0;
break;
case SOFTWARE_SPI_Mode1:
software_spi.CPOL = 0;
software_spi.CPHA = 1;
break;
case SOFTWARE_SPI_Mode2:
software_spi.CPOL = 1;
software_spi.CPHA = 0;
break;
case SOFTWARE_SPI_Mode3:
software_spi.CPOL = 1;
software_spi.CPHA = 1;
break;
}
}
void SYSFS_software_spi_setClockDivider(uint8_t div)
{
if(div > 8) {
SYSFS_SOFTWARE_SPI_Debug("div must be 0-7\r\n");
return;
}
switch (div) {
case SOFTWARE_SPI_CLOCK_DIV2:
software_spi.Delay = 2;
break;
case SOFTWARE_SPI_CLOCK_DIV4:
software_spi.Delay = 4;
break;
case SOFTWARE_SPI_CLOCK_DIV8:
software_spi.Delay = 8;
break;
case SOFTWARE_SPI_CLOCK_DIV16:
software_spi.Delay = 16;
break;
case SOFTWARE_SPI_CLOCK_DIV32:
software_spi.Delay = 32;
break;
case SOFTWARE_SPI_CLOCK_DIV64:
software_spi.Delay = 64;
break;
case SOFTWARE_SPI_CLOCK_DIV128:
software_spi.Delay = 128;
break;
default:
software_spi.Delay = 128;
break;
}
}
/******************************************************************************
function: SPI Mode 0
parameter:
Info:
******************************************************************************/
uint8_t SYSFS_software_spi_transfer(uint8_t value)
{
// printf("value = %d\r\n", value);
uint8_t Read_data;
if (software_spi.Order == SOFTWARE_SPI_LSBFIRST) {
uint8_t temp =
((value & 0x01) << 7) |
((value & 0x02) << 5) |
((value & 0x04) << 3) |
((value & 0x08) << 1) |
((value & 0x10) >> 1) |
((value & 0x20) >> 3) |
((value & 0x40) >> 5) |
((value & 0x80) >> 7);
value = temp;
}
uint8_t delay = software_spi.Delay >> 1;
for(int j=delay; j > 0; j--);
// printf("value = %d\r\n", value);
uint8_t Read_miso = 0;
SYSFS_GPIO_Write(software_spi.SCLK_PIN, 0);
for (uint8_t bit = 0; bit < 8; bit++) {
SYSFS_GPIO_Write(software_spi.SCLK_PIN, 0);
// for(int j=delay; j > 0; j--);// DELAY
if (software_spi.CPHA) {
Read_miso = SYSFS_GPIO_Read(software_spi.MISO_PIN);
if (software_spi.Order == SOFTWARE_SPI_LSBFIRST) {
Read_data <<= 1;
Read_data |= Read_miso;
} else {
Read_data >>= 1;
Read_data |= Read_miso << 7;
}
} else {
SYSFS_GPIO_Write(software_spi.MOSI_PIN, ((value<<bit) & 0x80) ? HIGH : LOW);
}
// for(int j=delay; j > 0; j--);// DELAY
SYSFS_GPIO_Write(software_spi.SCLK_PIN, 1);
// for(int j=delay; j > 0; j--);// DELAY
if (software_spi.CPHA) {
SYSFS_GPIO_Write(software_spi.MOSI_PIN, ((value<<bit) & 0x80) ? HIGH : LOW);
} else {
Read_miso = SYSFS_GPIO_Read(software_spi.MISO_PIN);
if (software_spi.Order == SOFTWARE_SPI_LSBFIRST) {
Read_data <<= 1;
Read_data |= Read_miso;
} else {
Read_data >>= 1;
Read_data |= Read_miso << 7;
}
}
// for(int j=delay; j > 0; j--);// DELAY
}
return Read_data;
}

View File

@@ -0,0 +1,111 @@
/*****************************************************************************
* | File : sysfs_software_spi.h
* | Author : Waveshare team
* | Function : Read and write /sys/class/gpio, software spi
* | Info :
*----------------
* | This version: V1.0
* | Date : 2019-06-05
* | Info : Basic version
*
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef __SYSFS_SOFTWARE_SPI_
#define __SYSFS_SOFTWARE_SPI_
#include "sysfs_gpio.h"
#include <stdint.h>
#include <stdio.h>
#define SYSFS_SOFTWARE_SPI_DEBUG 1
#if SYSFS_SOFTWARE_SPI_DEBUG
#define SYSFS_SOFTWARE_SPI_Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define SYSFS_SOFTWARE_SPI_Debug(__info,...)
#endif
/**
* SPI communication mode
**/
typedef enum {
SOFTWARE_SPI_Mode0, /* Clock Polarity is 0 and Clock Phase is 0 */
SOFTWARE_SPI_Mode1, /* Clock Polarity is 0 and Clock Phase is 1 */
SOFTWARE_SPI_Mode2, /* Clock Polarity is 1 and Clock Phase is 0 */
SOFTWARE_SPI_Mode3, /* Clock Polarity is 1 and Clock Phase is 1 */
} SOFTWARE_SPI_Mode;
/**
* SPI clock(div)
**/
typedef enum {
SOFTWARE_SPI_CLOCK_DIV2,
SOFTWARE_SPI_CLOCK_DIV4,
SOFTWARE_SPI_CLOCK_DIV8,
SOFTWARE_SPI_CLOCK_DIV16,
SOFTWARE_SPI_CLOCK_DIV32,
SOFTWARE_SPI_CLOCK_DIV64,
SOFTWARE_SPI_CLOCK_DIV128,
} SOFTWARE_SPI_Clock;
/**
* Define SPI type
**/
typedef enum {
SOFTWARE_SPI_Master,
SOFTWARE_SPI_Slave,
} SOFTWARE_SPI_Type;
/**
* Define SPI order
**/
typedef enum {
SOFTWARE_SPI_LSBFIRST,
SOFTWARE_SPI_MSBFIRST,
} SOFTWARE_SPI_Order;
/**
* Define SPI attribute
**/
typedef struct SPIStruct {
//GPIO
uint16_t SCLK_PIN;
uint16_t MOSI_PIN;
uint16_t MISO_PIN;
uint16_t CS_PIN;
//Mode
SOFTWARE_SPI_Mode Mode;
uint8_t CPOL;
uint8_t CPHA;
SOFTWARE_SPI_Clock Delay;
SOFTWARE_SPI_Type Type;
SOFTWARE_SPI_Order Order;
} SOFTWARE_SPI;
void SYSFS_software_spi_begin(void);
void SYSFS_software_spi_end(void);
void SYSFS_software_spi_setBitOrder(uint8_t order);
void SYSFS_software_spi_setDataMode(uint8_t mode);
void SYSFS_software_spi_setClockDivider(uint8_t div);
uint8_t SYSFS_software_spi_transfer(uint8_t value);
#endif

1384
c/libs/Fonts/font12.c Normal file

File diff suppressed because it is too large Load Diff

1764
c/libs/Fonts/font16.c Normal file

File diff suppressed because it is too large Load Diff

2142
c/libs/Fonts/font20.c Normal file

File diff suppressed because it is too large Load Diff

2520
c/libs/Fonts/font24.c Normal file

File diff suppressed because it is too large Load Diff

1004
c/libs/Fonts/font8.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -85,8 +85,6 @@ extern sFONT Font16;
extern sFONT Font12;
extern sFONT Font8;
extern cFONT Font12CN;
extern cFONT Font24CN;
#ifdef __cplusplus
}
#endif

528
c/libs/GUI/GUI_BMPfile.c Normal file
View File

@@ -0,0 +1,528 @@
/*****************************************************************************
* | File : GUI_BMPfile.h
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V2.3
* | Date : 2022-07-27
* | Info :
* -----------------------------------------------------------------------------
* V2.3(2022-07-27):
* 1.Add GUI_ReadBmp_RGB_4Color()
* V2.2(2020-07-08):
* 1.Add GUI_ReadBmp_RGB_7Color()
* V2.1(2019-10-10):
* 1.Add GUI_ReadBmp_4Gray()
* V2.0(2018-11-12):
* 1.Change file name: GUI_BMP.h -> GUI_BMPfile.h
* 2.fix: GUI_ReadBmp()
* Now Xstart and Xstart can control the position of the picture normally,
* and support the display of images of any size. If it is larger than
* the actual display range, it will not be displayed.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "GUI_BMPfile.h"
#include "GUI_Paint.h"
#include "../Config/Debug.h"
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h> //exit()
#include <string.h> //memset()
#include <math.h> //memset()
#include <stdio.h>
UBYTE GUI_ReadBmp(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
UWORD Image_Width_Byte = (bmpInfoHeader.biWidth % 8 == 0)? (bmpInfoHeader.biWidth / 8): (bmpInfoHeader.biWidth / 8 + 1);
UWORD Bmp_Width_Byte = (Image_Width_Byte % 4 == 0) ? Image_Width_Byte: ((Image_Width_Byte / 4 + 1) * 4);
UBYTE Image[Image_Width_Byte * bmpInfoHeader.biHeight];
memset(Image, 0xFF, Image_Width_Byte * bmpInfoHeader.biHeight);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
if(readbyte != 1) {
Debug("the bmp Image is not a monochrome bitmap!\n");
exit(0);
}
// Determine black and white based on the palette
UWORD i;
UWORD Bcolor, Wcolor;
UWORD bmprgbquadsize = pow(2, bmpInfoHeader.biBitCount);// 2^1 = 2
BMPRGBQUAD bmprgbquad[bmprgbquadsize]; //palette
// BMPRGBQUAD bmprgbquad[2]; //palette
for(i = 0; i < bmprgbquadsize; i++){
// for(i = 0; i < 2; i++) {
fread(&bmprgbquad[i], sizeof(BMPRGBQUAD), 1, fp);
}
if(bmprgbquad[0].rgbBlue == 0xff && bmprgbquad[0].rgbGreen == 0xff && bmprgbquad[0].rgbRed == 0xff) {
Bcolor = BLACK;
Wcolor = WHITE;
} else {
Bcolor = WHITE;
Wcolor = BLACK;
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata;
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for(x = 0; x < Bmp_Width_Byte; x++) {//Show a line in the line
if(fread((char *)&Rdata, 1, readbyte, fp) != readbyte) {
perror("get bmpdata:\r\n");
break;
}
if(x < Image_Width_Byte) { //bmp
Image[x + (bmpInfoHeader.biHeight - y - 1) * Image_Width_Byte] = Rdata;
// printf("rdata = %d\r\n", Rdata);
}
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
UBYTE color, temp;
for(y = 0; y < bmpInfoHeader.biHeight; y++) {
for(x = 0; x < bmpInfoHeader.biWidth; x++) {
if(x > Paint.Width || y > Paint.Height) {
break;
}
temp = Image[(x / 8) + (y * Image_Width_Byte)];
color = (((temp << (x%8)) & 0x80) == 0x80) ?Bcolor:Wcolor;
Paint_SetPixel(Xstart + x, Ystart + y, color);
}
}
return 0;
}
/*************************************************************************
*************************************************************************/
UBYTE GUI_ReadBmp_4Gray(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
UWORD Image_Width_Byte = (bmpInfoHeader.biWidth % 4 == 0)? (bmpInfoHeader.biWidth / 4): (bmpInfoHeader.biWidth / 4 + 1);
UWORD Bmp_Width_Byte = (bmpInfoHeader.biWidth % 2 == 0)? (bmpInfoHeader.biWidth / 2): (bmpInfoHeader.biWidth / 2 + 1);
UBYTE Image[Image_Width_Byte * bmpInfoHeader.biHeight * 2];
memset(Image, 0xFF, Image_Width_Byte * bmpInfoHeader.biHeight * 2);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
printf("biBitCount = %d\r\n",readbyte);
if(readbyte != 4){
Debug("Bmp image is not a 4-color bitmap!\n");
exit(0);
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata;
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for(x = 0; x < Bmp_Width_Byte; x++) {//Show a line in the line
if(fread((char *)&Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(x < Image_Width_Byte*2) { //bmp
Image[x + (bmpInfoHeader.biHeight - y - 1) * Image_Width_Byte*2] = Rdata;
}
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
UBYTE color, temp;
printf("bmpInfoHeader.biWidth = %d\r\n",bmpInfoHeader.biWidth);
printf("bmpInfoHeader.biHeight = %d\r\n",bmpInfoHeader.biHeight);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {
for(x = 0; x < bmpInfoHeader.biWidth; x++) {
if(x > Paint.Width || y > Paint.Height) {
break;
}
temp = Image[x/2 + y * bmpInfoHeader.biWidth/2] >> ((x%2)? 0:4);//0xf 0x8 0x7 0x0
color = temp>>2; //11 10 01 00
Paint_SetPixel(Xstart + x, Ystart + y, color);
}
}
return 0;
}
UBYTE GUI_ReadBmp_16Gray(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
// They are both the same width in bytes
// round up to the next byte
UWORD Width_Byte = (bmpInfoHeader.biWidth + 1) / 2;
UBYTE Image[Width_Byte * bmpInfoHeader.biHeight];
memset(Image, 0xFF, Width_Byte * bmpInfoHeader.biHeight);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
printf("biBitCount = %d\r\n",readbyte);
if(readbyte != 4) {
Debug("Bmp image is not a 4-bit bitmap!\n");
exit(0);
}
// Determine colors based on the palette
// A map from palette entry to color
UBYTE colors[16];
UBYTE i;
BMPRGBQUAD rgbData;
for (i = 0; i < 16; i++){
fread(&rgbData, sizeof(BMPRGBQUAD), 1, fp);
// Work out the closest colour
// 16 colours over 0-255 => 0-8 => 0, 9-25 => 1 (17), 26-42 => 2 (34), etc
// Base it on red
colors[i] = (rgbData.rgbRed + 8) / 17;
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata;
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for (y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for (x = 0; x < Width_Byte; x++) {//Show a line in the line
if (fread((char *) &Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
Image[x + (bmpInfoHeader.biHeight - y - 1) * Width_Byte] = Rdata;
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
UBYTE coloridx;
printf("bmpInfoHeader.biWidth = %d\r\n", bmpInfoHeader.biWidth);
printf("bmpInfoHeader.biHeight = %d\r\n", bmpInfoHeader.biHeight);
for (y = 0; y < bmpInfoHeader.biHeight; y++) {
for (x = 0; x < bmpInfoHeader.biWidth; x++) {
if (Xstart + x > Paint.Width || Ystart + y > Paint.Height)
break;
coloridx = (Image[x / 2 + y * Width_Byte] >> ((x % 2) ? 0 : 4)) & 15;
Paint_SetPixel(Xstart + x, Ystart + y, colors[coloridx]);
}
}
return 0;
}
UBYTE GUI_ReadBmp_RGB_7Color(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
UDOUBLE Image_Byte = bmpInfoHeader.biWidth * bmpInfoHeader.biHeight * 3;
UBYTE Image[Image_Byte];
memset(Image, 0xFF, Image_Byte);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
if(readbyte != 24){
Debug("Bmp image is not 24 bitmap!\n");
exit(0);
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata[3];
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for(x = 0; x < bmpInfoHeader.biWidth ; x++) {//Show a line in the line
if(fread((char *)Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+1, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+2, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 0;//Black
}else if(Rdata[0] == 255 && Rdata[1] == 255 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 1;//White
}else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 2;//Green
}else if(Rdata[0] == 255 && Rdata[1] == 0 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 3;//Blue
}else if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 4;//Red
}else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 5;//Yellow
}else if(Rdata[0] == 0 && Rdata[1] == 128 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 6;//Orange
}
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
for(y = 0; y < bmpInfoHeader.biHeight; y++) {
for(x = 0; x < bmpInfoHeader.biWidth; x++) {
if(x > Paint.Width || y > Paint.Height) {
break;
}
Paint_SetPixel(Xstart + x, Ystart + y, Image[bmpInfoHeader.biHeight * bmpInfoHeader.biWidth - 1 -(bmpInfoHeader.biWidth-x-1+(y* bmpInfoHeader.biWidth))]);
}
}
return 0;
}
UBYTE GUI_ReadBmp_RGB_4Color(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
UDOUBLE Image_Byte = bmpInfoHeader.biWidth * bmpInfoHeader.biHeight * 3;
UBYTE Image[Image_Byte];
memset(Image, 0xFF, Image_Byte);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
if(readbyte != 24){
Debug("Bmp image is not 24 bitmap!\n");
exit(0);
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata[3];
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for(x = 0; x < bmpInfoHeader.biWidth ; x++) {//Show a line in the line
if(fread((char *)Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+1, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+2, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(Rdata[0] < 128 && Rdata[1] < 128 && Rdata[2] < 128){
Image[x+(y* bmpInfoHeader.biWidth )] = 0;//Black
}else if(Rdata[0] > 127 && Rdata[1] > 127 && Rdata[2] > 127){
Image[x+(y* bmpInfoHeader.biWidth )] = 1;//White
}else if(Rdata[0] < 128 && Rdata[1] > 127 && Rdata[2] > 127){
Image[x+(y* bmpInfoHeader.biWidth )] = 2;//Yellow
}else if(Rdata[0] < 128 && Rdata[1] < 128 && Rdata[2] > 127){
Image[x+(y* bmpInfoHeader.biWidth )] = 3;//Red
}
}
if(bmpInfoHeader.biWidth % 4 != 0)
{
for (UWORD i = 0; i < (bmpInfoHeader.biWidth % 4); i++)
{
if(fread((char *)Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
}
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
for(y = 0; y < bmpInfoHeader.biHeight; y++) {
for(x = 0; x < bmpInfoHeader.biWidth; x++) {
if(x > Paint.Width || y > Paint.Height) {
break;
}
Paint_SetPixel(Xstart + x, Ystart + y, Image[bmpInfoHeader.biHeight * bmpInfoHeader.biWidth - 1 -(bmpInfoHeader.biWidth-x-1+(y* bmpInfoHeader.biWidth))]);
}
}
return 0;
}
UBYTE GUI_ReadBmp_RGB_6Color(const char *path, UWORD Xstart, UWORD Ystart)
{
FILE *fp; //Define a file pointer
BMPFILEHEADER bmpFileHeader; //Define a bmp file header structure
BMPINFOHEADER bmpInfoHeader; //Define a bmp info header structure
// Binary file open
if((fp = fopen(path, "rb")) == NULL) {
Debug("Cann't open the file!\n");
exit(0);
}
// Set the file pointer from the beginning
fseek(fp, 0, SEEK_SET);
fread(&bmpFileHeader, sizeof(BMPFILEHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 14
fread(&bmpInfoHeader, sizeof(BMPINFOHEADER), 1, fp); //sizeof(BMPFILEHEADER) must be 50
printf("pixel = %d * %d\r\n", bmpInfoHeader.biWidth, bmpInfoHeader.biHeight);
UDOUBLE Image_Byte = bmpInfoHeader.biWidth * bmpInfoHeader.biHeight * 3;
UBYTE Image[Image_Byte];
memset(Image, 0xFF, Image_Byte);
// Determine if it is a monochrome bitmap
int readbyte = bmpInfoHeader.biBitCount;
if(readbyte != 24){
Debug("Bmp image is not 24 bitmap!\n");
exit(0);
}
// Read image data into the cache
UWORD x, y;
UBYTE Rdata[3];
fseek(fp, bmpFileHeader.bOffset, SEEK_SET);
for(y = 0; y < bmpInfoHeader.biHeight; y++) {//Total display column
for(x = 0; x < bmpInfoHeader.biWidth ; x++) {//Show a line in the line
if(fread((char *)Rdata, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+1, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(fread((char *)Rdata+2, 1, 1, fp) != 1) {
perror("get bmpdata:\r\n");
break;
}
if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 0;//Black
}else if(Rdata[0] == 255 && Rdata[1] == 255 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 1;//White
}else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 2;//Yellow
}else if(Rdata[0] == 0 && Rdata[1] == 0 && Rdata[2] == 255){
Image[x+(y* bmpInfoHeader.biWidth )] = 3;//Red
// }else if(Rdata[0] == 0 && Rdata[1] == 128 && Rdata[2] == 255){
// Image[x+(y* bmpInfoHeader.biWidth )] = 4;//Orange
}else if(Rdata[0] == 255 && Rdata[1] == 0 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 5;//Blue
}else if(Rdata[0] == 0 && Rdata[1] == 255 && Rdata[2] == 0){
Image[x+(y* bmpInfoHeader.biWidth )] = 6;//Green
}
}
}
fclose(fp);
// Refresh the image to the display buffer based on the displayed orientation
for(y = 0; y < bmpInfoHeader.biHeight; y++) {
for(x = 0; x < bmpInfoHeader.biWidth; x++) {
if(x > Paint.Width || y > Paint.Height) {
break;
}
Paint_SetPixel(Xstart + x, Ystart + y, Image[bmpInfoHeader.biHeight * bmpInfoHeader.biWidth - 1 -(bmpInfoHeader.biWidth-x-1+(y* bmpInfoHeader.biWidth))]);
}
}
return 0;
}

750
c/libs/GUI/GUI_Paint.c Normal file
View File

@@ -0,0 +1,750 @@
/******************************************************************************
* | File : GUI_Paint.c
* | Author : Waveshare electronics
* | Function : Achieve drawing: draw points, lines, boxes, circles and
* their size, solid dotted line, solid rectangle hollow
* rectangle, solid circle hollow circle.
* | Info :
* Achieve display characters: Display a single character, string, number
* Achieve time display: adaptive size display time minutes and seconds
*----------------
* | This version: V3.2
* | Date : 2020-07-10
* | Info :
* -----------------------------------------------------------------------------
* V3.2(2020-07-10):
* 1.Change: Paint_SetScale(UBYTE scale)
* Add scale 7 for 5.65f e-Parper
* 2.Change: Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
* Add the branch for scale 7
* 3.Change: Paint_Clear(UWORD Color)
* Add the branch for scale 7
* -----------------------------------------------------------------------------
* V3.1(2019-10-10):
* 1. Add gray level
* PAINT Add Scale
* 2. Add void Paint_SetScale(UBYTE scale);
* -----------------------------------------------------------------------------
* V3.0(2019-04-18):
* 1.Change:
* Paint_DrawPoint(..., DOT_STYLE DOT_STYLE)
* => Paint_DrawPoint(..., DOT_STYLE Dot_Style)
* Paint_DrawLine(..., LINE_STYLE Line_Style, DOT_PIXEL Dot_Pixel)
* => Paint_DrawLine(..., DOT_PIXEL Line_width, LINE_STYLE Line_Style)
* Paint_DrawRectangle(..., DRAW_FILL Filled, DOT_PIXEL Dot_Pixel)
* => Paint_DrawRectangle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
* Paint_DrawCircle(..., DRAW_FILL Draw_Fill, DOT_PIXEL Dot_Pixel)
* => Paint_DrawCircle(..., DOT_PIXEL Line_width, DRAW_FILL Draw_Filll)
*
* -----------------------------------------------------------------------------
* V2.0(2018-11-15):
* 1.add: Paint_NewImage()
* Create an image's properties
* 2.add: Paint_SelectImage()
* Select the picture to be drawn
* 3.add: Paint_SetRotate()
* Set the direction of the cache
* 4.add: Paint_RotateImage()
* Can flip the picture, Support 0-360 degrees,
* but only 90.180.270 rotation is better
* 4.add: Paint_SetMirroring()
* Can Mirroring the picture, horizontal, vertical, origin
* 5.add: Paint_DrawString_CN()
* Can display Chinese(GB1312)
*
* -----------------------------------------------------------------------------
* V1.0(2018-07-17):
* Create library
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documnetation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
******************************************************************************/
#include "GUI_Paint.h"
#include "../Config/DEV_Config.h"
#include "../Config/Debug.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h> //memset()
#include <math.h>
PAINT Paint;
/******************************************************************************
function: Create Image
parameter:
image : Pointer to the image cache
width : The width of the picture
Height : The height of the picture
Color : Whether the picture is inverted
******************************************************************************/
void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
{
Paint.Image = NULL;
Paint.Image = image;
Paint.WidthMemory = Width;
Paint.HeightMemory = Height;
Paint.Color = Color;
Paint.Scale = 2;
Paint.WidthByte = (Width % 8 == 0)? (Width / 8 ): (Width / 8 + 1);
Paint.HeightByte = Height;
// printf("WidthByte = %d, HeightByte = %d\r\n", Paint.WidthByte, Paint.HeightByte);
// printf(" EPD_WIDTH / 8 = %d\r\n", 122 / 8);
Paint.Rotate = Rotate;
Paint.Mirror = MIRROR_NONE;
if(Rotate == ROTATE_0 || Rotate == ROTATE_180) {
Paint.Width = Width;
Paint.Height = Height;
} else {
Paint.Width = Height;
Paint.Height = Width;
}
}
/******************************************************************************
function: Select Image
parameter:
image : Pointer to the image cache
******************************************************************************/
void Paint_SelectImage(UBYTE *image)
{
Paint.Image = image;
}
/******************************************************************************
function: Select Image Rotate
parameter:
Rotate : 0,90,180,270
******************************************************************************/
void Paint_SetRotate(UWORD Rotate)
{
if(Rotate == ROTATE_0 || Rotate == ROTATE_90 || Rotate == ROTATE_180 || Rotate == ROTATE_270) {
Debug("Set image Rotate %d\r\n", Rotate);
Paint.Rotate = Rotate;
} else {
Debug("rotate = 0, 90, 180, 270\r\n");
}
}
/******************************************************************************
function: Select Image mirror
parameter:
mirror :Not mirror,Horizontal mirror,Vertical mirror,Origin mirror
******************************************************************************/
void Paint_SetMirroring(UBYTE mirror)
{
if(mirror == MIRROR_NONE || mirror == MIRROR_HORIZONTAL ||
mirror == MIRROR_VERTICAL || mirror == MIRROR_ORIGIN) {
Debug("mirror image x:%s, y:%s\r\n",(mirror & 0x01)? "mirror":"none", ((mirror >> 1) & 0x01)? "mirror":"none");
Paint.Mirror = mirror;
} else {
Debug("mirror should be MIRROR_NONE, MIRROR_HORIZONTAL, \
MIRROR_VERTICAL or MIRROR_ORIGIN\r\n");
}
}
void Paint_SetScale(UBYTE scale)
{
if(scale == 2){
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory % 8 == 0)? (Paint.WidthMemory / 8 ): (Paint.WidthMemory / 8 + 1);
}else if(scale == 4){
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory % 4 == 0)? (Paint.WidthMemory / 4 ): (Paint.WidthMemory / 4 + 1);
}else if(scale == 6 || scale == 7 || scale == 16){
/* 7 colours are only applicable with 5in65 e-Paper */
/* 16 colours are used for dithering */
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory % 2 == 0)? (Paint.WidthMemory / 2 ): (Paint.WidthMemory / 2 + 1);;
}else{
Debug("Set Scale Input parameter error\r\n");
Debug("Scale Only support: 2 4 7 16\r\n");
}
}
/******************************************************************************
function: Draw Pixels
parameter:
Xpoint : At point X
Ypoint : At point Y
Color : Painted colors
******************************************************************************/
void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
{
if(Xpoint > Paint.Width || Ypoint > Paint.Height){
Debug("Exceeding display boundaries\r\n");
return;
}
UWORD X, Y;
switch(Paint.Rotate) {
case 0:
X = Xpoint;
Y = Ypoint;
break;
case 90:
X = Paint.WidthMemory - Ypoint - 1;
Y = Xpoint;
break;
case 180:
X = Paint.WidthMemory - Xpoint - 1;
Y = Paint.HeightMemory - Ypoint - 1;
break;
case 270:
X = Ypoint;
Y = Paint.HeightMemory - Xpoint - 1;
break;
default:
return;
}
switch(Paint.Mirror) {
case MIRROR_NONE:
break;
case MIRROR_HORIZONTAL:
X = Paint.WidthMemory - X - 1;
break;
case MIRROR_VERTICAL:
Y = Paint.HeightMemory - Y - 1;
break;
case MIRROR_ORIGIN:
X = Paint.WidthMemory - X - 1;
Y = Paint.HeightMemory - Y - 1;
break;
default:
return;
}
if(X > Paint.WidthMemory || Y > Paint.HeightMemory){
Debug("Exceeding display boundaries\r\n");
return;
}
if(Paint.Scale == 2){
UDOUBLE Addr = X / 8 + Y * Paint.WidthByte;
UBYTE Rdata = Paint.Image[Addr];
if(Color == BLACK)
Paint.Image[Addr] = Rdata & ~(0x80 >> (X % 8));
else
Paint.Image[Addr] = Rdata | (0x80 >> (X % 8));
}else if(Paint.Scale == 4){
UDOUBLE Addr = X / 4 + Y * Paint.WidthByte;
Color = Color % 4;//Guaranteed color scale is 4 --- 0~3
UBYTE Rdata = Paint.Image[Addr];
Rdata = Rdata & (~(0xC0 >> ((X % 4)*2)));//Clear first, then set value
Paint.Image[Addr] = Rdata | ((Color << 6) >> ((X % 4)*2));
}else if(Paint.Scale == 6 || Paint.Scale == 7 || Paint.Scale == 16){
UDOUBLE Addr = X / 2 + Y * Paint.WidthByte;
UBYTE Rdata = Paint.Image[Addr];
Rdata = Rdata & (~(0xF0 >> ((X % 2)*4)));//Clear first, then set value
Paint.Image[Addr] = Rdata | ((Color << 4) >> ((X % 2)*4));
// printf("Add = %d ,data = %d\r\n",Addr,Rdata);
}
}
/******************************************************************************
function: Clear the color of the picture
parameter:
Color : Painted colors
******************************************************************************/
void Paint_Clear(UWORD Color)
{
if(Paint.Scale == 2) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte
UDOUBLE Addr = X + Y*Paint.WidthByte;
Paint.Image[Addr] = Color;
}
}
}else if(Paint.Scale == 4) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {
UDOUBLE Addr = X + Y*Paint.WidthByte;
Paint.Image[Addr] = (Color<<6)|(Color<<4)|(Color<<2)|Color;
}
}
}else if(Paint.Scale == 6 || Paint.Scale == 7 || Paint.Scale == 16) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {
UDOUBLE Addr = X + Y*Paint.WidthByte;
Paint.Image[Addr] = (Color<<4)|Color;
}
}
}
}
/******************************************************************************
function: Clear the color of a window
parameter:
Xstart : x starting point
Ystart : Y starting point
Xend : x end point
Yend : y end point
Color : Painted colors
******************************************************************************/
void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
{
UWORD X, Y;
for (Y = Ystart; Y < Yend; Y++) {
for (X = Xstart; X < Xend; X++) {//8 pixel = 1 byte
Paint_SetPixel(X, Y, Color);
}
}
}
/******************************************************************************
function: Draw Point(Xpoint, Ypoint) Fill the color
parameter:
Xpoint : The Xpoint coordinate of the point
Ypoint : The Ypoint coordinate of the point
Color : Painted color
Dot_Pixel : point size
Dot_Style : point Style
******************************************************************************/
void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color,
DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
{
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DrawPoint Input exceeds the normal display range\r\n");
return;
}
int16_t XDir_Num , YDir_Num;
if (Dot_Style == DOT_FILL_AROUND) {
for (XDir_Num = 0; XDir_Num < 2 * Dot_Pixel - 1; XDir_Num++) {
for (YDir_Num = 0; YDir_Num < 2 * Dot_Pixel - 1; YDir_Num++) {
if(Xpoint + XDir_Num - Dot_Pixel < 0 || Ypoint + YDir_Num - Dot_Pixel < 0)
break;
// printf("x = %d, y = %d\r\n", Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel);
Paint_SetPixel(Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel, Color);
}
}
} else {
for (XDir_Num = 0; XDir_Num < Dot_Pixel; XDir_Num++) {
for (YDir_Num = 0; YDir_Num < Dot_Pixel; YDir_Num++) {
Paint_SetPixel(Xpoint + XDir_Num - 1, Ypoint + YDir_Num - 1, Color);
}
}
}
}
/******************************************************************************
function: Draw a line of arbitrary slope
parameter:
Xstart :Starting Xpoint point coordinates
Ystart :Starting Xpoint point coordinates
Xend :End point Xpoint coordinate
Yend :End point Ypoint coordinate
Color :The color of the line segment
Line_width : Line width
Line_Style: Solid and dotted lines
******************************************************************************/
void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style)
{
if (Xstart > Paint.Width || Ystart > Paint.Height ||
Xend > Paint.Width || Yend > Paint.Height) {
Debug("Paint_DrawLine Input exceeds the normal display range\r\n");
return;
}
UWORD Xpoint = Xstart;
UWORD Ypoint = Ystart;
int dx = (int)Xend - (int)Xstart >= 0 ? Xend - Xstart : Xstart - Xend;
int dy = (int)Yend - (int)Ystart <= 0 ? Yend - Ystart : Ystart - Yend;
// Increment direction, 1 is positive, -1 is counter;
int XAddway = Xstart < Xend ? 1 : -1;
int YAddway = Ystart < Yend ? 1 : -1;
//Cumulative error
int Esp = dx + dy;
char Dotted_Len = 0;
for (;;) {
Dotted_Len++;
//Painted dotted line, 2 point is really virtual
if (Line_Style == LINE_STYLE_DOTTED && Dotted_Len % 3 == 0) {
//Debug("LINE_DOTTED\r\n");
Paint_DrawPoint(Xpoint, Ypoint, IMAGE_BACKGROUND, Line_width, DOT_STYLE_DFT);
Dotted_Len = 0;
} else {
Paint_DrawPoint(Xpoint, Ypoint, Color, Line_width, DOT_STYLE_DFT);
}
if (2 * Esp >= dy) {
if (Xpoint == Xend)
break;
Esp += dy;
Xpoint += XAddway;
}
if (2 * Esp <= dx) {
if (Ypoint == Yend)
break;
Esp += dx;
Ypoint += YAddway;
}
}
}
/******************************************************************************
function: Draw a rectangle
parameter:
Xstart :Rectangular Starting Xpoint point coordinates
Ystart :Rectangular Starting Xpoint point coordinates
Xend :Rectangular End point Xpoint coordinate
Yend :Rectangular End point Ypoint coordinate
Color :The color of the Rectangular segment
Line_width: Line width
Draw_Fill : Whether to fill the inside of the rectangle
******************************************************************************/
void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
{
if (Xstart > Paint.Width || Ystart > Paint.Height ||
Xend > Paint.Width || Yend > Paint.Height) {
Debug("Input exceeds the normal display range\r\n");
return;
}
if (Draw_Fill) {
UWORD Ypoint;
for(Ypoint = Ystart; Ypoint < Yend; Ypoint++) {
Paint_DrawLine(Xstart, Ypoint, Xend, Ypoint, Color , Line_width, LINE_STYLE_SOLID);
}
} else {
Paint_DrawLine(Xstart, Ystart, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xstart, Ystart, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xend, Yend, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xend, Yend, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
}
}
/******************************************************************************
function: Use the 8-point method to draw a circle of the
specified size at the specified position->
parameter:
X_Center :Center X coordinate
Y_Center :Center Y coordinate
Radius :circle Radius
Color :The color of the :circle segment
Line_width: Line width
Draw_Fill : Whether to fill the inside of the Circle
******************************************************************************/
void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius,
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
{
if (X_Center > Paint.Width || Y_Center >= Paint.Height) {
Debug("Paint_DrawCircle Input exceeds the normal display range\r\n");
return;
}
//Draw a circle from(0, R) as a starting point
int16_t XCurrent, YCurrent;
XCurrent = 0;
YCurrent = Radius;
//Cumulative error,judge the next point of the logo
int16_t Esp = 3 - (Radius << 1 );
int16_t sCountY;
if (Draw_Fill == DRAW_FILL_FULL) {
while (XCurrent <= YCurrent ) { //Realistic circles
for (sCountY = XCurrent; sCountY <= YCurrent; sCountY ++ ) {
Paint_DrawPoint(X_Center + XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//1
Paint_DrawPoint(X_Center - XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//2
Paint_DrawPoint(X_Center - sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//3
Paint_DrawPoint(X_Center - sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//4
Paint_DrawPoint(X_Center - XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//5
Paint_DrawPoint(X_Center + XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//6
Paint_DrawPoint(X_Center + sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//7
Paint_DrawPoint(X_Center + sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
if (Esp < 0 )
Esp += 4 * XCurrent + 6;
else {
Esp += 10 + 4 * (XCurrent - YCurrent );
YCurrent --;
}
XCurrent ++;
}
} else { //Draw a hollow circle
while (XCurrent <= YCurrent ) {
Paint_DrawPoint(X_Center + XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//1
Paint_DrawPoint(X_Center - XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//2
Paint_DrawPoint(X_Center - YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//3
Paint_DrawPoint(X_Center - YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//4
Paint_DrawPoint(X_Center - XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//5
Paint_DrawPoint(X_Center + XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//6
Paint_DrawPoint(X_Center + YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//7
Paint_DrawPoint(X_Center + YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//0
if (Esp < 0 )
Esp += 4 * XCurrent + 6;
else {
Esp += 10 + 4 * (XCurrent - YCurrent );
YCurrent --;
}
XCurrent ++;
}
}
}
/******************************************************************************
function: Show English characters
parameter:
Xpoint :X coordinate
Ypoint :Y coordinate
Acsii_Char :To display the English characters
Font :A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawChar(UWORD Xpoint, UWORD Ypoint, const char Acsii_Char,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
UWORD Page, Column;
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DrawChar Input exceeds the normal display range\r\n");
return;
}
uint32_t Char_Offset = (Acsii_Char - ' ') * Font->Height * (Font->Width / 8 + (Font->Width % 8 ? 1 : 0));
const unsigned char *ptr = &Font->table[Char_Offset];
for (Page = 0; Page < Font->Height; Page ++ ) {
for (Column = 0; Column < Font->Width; Column ++ ) {
//To determine whether the font background color and screen background color is consistent
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
if (*ptr & (0x80 >> (Column % 8)))
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
if (*ptr & (0x80 >> (Column % 8))) {
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Background);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
}
//One pixel is 8 bits
if (Column % 8 == 7)
ptr++;
}// Write a line
if (Font->Width % 8 != 0)
ptr++;
}// Write all
}
/******************************************************************************
function: Display the string
parameter:
Xstart :X coordinate
Ystart :Y coordinate
pString :The first address of the English string to be displayed
Font :A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawString(UWORD Xstart, UWORD Ystart, const char * pString,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
UWORD Xpoint = Xstart;
UWORD Ypoint = Ystart;
if (Xstart > Paint.Width || Ystart > Paint.Height) {
Debug("Paint_DrawString_EN Input exceeds the normal display range\r\n");
return;
}
while (* pString != '\0') {
//if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
if ((Xpoint + Font->Width ) > Paint.Width ) {
Xpoint = Xstart;
Ypoint += Font->Height;
}
// If the Y direction is full, reposition to(Xstart, Ystart)
if ((Ypoint + Font->Height ) > Paint.Height ) {
Xpoint = Xstart;
Ypoint = Ystart;
}
Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground);
//The next character of the address
pString ++;
//The next word of the abscissa increases the font of the broadband
Xpoint += Font->Width;
}
}
/******************************************************************************
function: Display nummber
parameter:
Xstart :X coordinate
Ystart : Y coordinate
Nummber : The number displayed
Font :A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
#define ARRAY_LEN 255
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
int16_t Num_Bit = 0, Str_Bit = 0;
uint8_t Str_Array[ARRAY_LEN] = {0}, Num_Array[ARRAY_LEN] = {0};
uint8_t *pStr = Str_Array;
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DisNum Input exceeds the normal display range\r\n");
return;
}
//Converts a number to a string
do {
Num_Array[Num_Bit] = Nummber % 10 + '0';
Num_Bit++;
Nummber /= 10;
} while(Nummber);
//The string is inverted
while (Num_Bit > 0) {
Str_Array[Str_Bit] = Num_Array[Num_Bit - 1];
Str_Bit ++;
Num_Bit --;
}
//show
Paint_DrawString(Xpoint, Ypoint, (const char*)pStr, Font, Color_Background, Color_Foreground);
}
/******************************************************************************
function: Display nummber (Able to display decimals)
parameter:
Xstart :X coordinate
Ystart : Y coordinate
Nummber : The number displayed
Font :A structure pointer that displays a character size
Digit : Fractional width
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawNumDecimals(UWORD Xpoint, UWORD Ypoint, double Nummber,
sFONT* Font, UWORD Digit, UWORD Color_Foreground, UWORD Color_Background)
{
int16_t Num_Bit = 0, Str_Bit = 0;
uint8_t Str_Array[ARRAY_LEN] = {0}, Num_Array[ARRAY_LEN] = {0};
uint8_t *pStr = Str_Array;
int temp = Nummber;
float decimals;
uint8_t i;
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DisNum Input exceeds the normal display range\r\n");
return;
}
if(Digit > 0) {
decimals = Nummber - temp;
for(i=Digit; i > 0; i--) {
decimals*=10;
}
temp = decimals;
//Converts a number to a string
for(i=Digit; i>0; i--) {
Num_Array[Num_Bit] = temp % 10 + '0';
Num_Bit++;
temp /= 10;
}
Num_Array[Num_Bit] = '.';
Num_Bit++;
}
temp = Nummber;
//Converts a number to a string
do {
Num_Array[Num_Bit] = temp % 10 + '0';
Num_Bit++;
temp /= 10;
} while(temp);
//The string is inverted
while (Num_Bit > 0) {
Str_Array[Str_Bit] = Num_Array[Num_Bit - 1];
Str_Bit ++;
Num_Bit --;
}
//show
Paint_DrawString(Xpoint, Ypoint, (const char*)pStr, Font, Color_Background, Color_Foreground);
}
/******************************************************************************
function: Display time
parameter:
Xstart :X coordinate
Ystart : Y coordinate
pTime : Time-related structures
Font :A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font,
UWORD Color_Foreground, UWORD Color_Background)
{
uint8_t value[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
UWORD Dx = Font->Width;
//Write data into the cache
Paint_DrawChar(Xstart , Ystart, value[pTime->Hour / 10], Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx , Ystart, value[pTime->Hour % 10], Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx + Dx / 4 + Dx / 2 , Ystart, ':' , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 2 + Dx / 2 , Ystart, value[pTime->Min / 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 3 + Dx / 2 , Ystart, value[pTime->Min % 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 4 + Dx / 2 - Dx / 4, Ystart, ':' , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 5 , Ystart, value[pTime->Sec / 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 6 , Ystart, value[pTime->Sec % 10] , Font, Color_Background, Color_Foreground);
}
/******************************************************************************
function: Display monochrome bitmap
parameter:
image_buffer :A picture data converted to a bitmap
info:
Use a computer to convert the image into a corresponding array,
and then embed the array directly into Imagedata.cpp as a .c file.
******************************************************************************/
void Paint_DrawBitMap(const unsigned char* image_buffer)
{
UWORD x, y;
UDOUBLE Addr = 0;
for (y = 0; y < Paint.HeightByte; y++) {
for (x = 0; x < Paint.WidthByte; x++) {//8 pixel = 1 byte
Addr = x + y * Paint.WidthByte;
Paint.Image[Addr] = (unsigned char)image_buffer[Addr];
}
}
}

View File

@@ -199,8 +199,7 @@ void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color,
//Display string
void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Acsii_Char, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawNumDecimals(UWORD Xpoint, UWORD Ypoint, double Nummber, sFONT* Font, UWORD Digit, UWORD Color_Foreground, UWORD Color_Background); // Able to display decimals
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);

View File

@@ -0,0 +1,370 @@
/*****************************************************************************
* | File : EPD_2in13_V4.c
* | Author : Waveshare team
* | Function : 2.13inch e-paper V4
* | Info :
*----------------
* | This version: V1.1
* | Date : 2021-10-30
* | Info :
* -----------------------------------------------------------------------------
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_2in13_V4.h"
#include "../Config/Debug.h"
/******************************************************************************
function : Software reset
parameter:
******************************************************************************/
static void EPD_2in13_V4_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(20);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(2);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(20);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void EPD_2in13_V4_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void EPD_2in13_V4_SendData(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Wait until the busy_pin goes LOW
parameter:
******************************************************************************/
void EPD_2in13_V4_ReadBusy(void)
{
Debug("e-Paper busy\r\n");
while(1)
{ //=1 BUSY
if(DEV_Digital_Read(EPD_BUSY_PIN)==0)
break;
DEV_Delay_ms(10);
}
DEV_Delay_ms(10);
Debug("e-Paper busy release\r\n");
}
/******************************************************************************
function : Setting the display window
parameter:
Xstart : X-axis starting position
Ystart : Y-axis starting position
Xend : End position of X-axis
Yend : End position of Y-axis
******************************************************************************/
static void EPD_2in13_V4_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
EPD_2in13_V4_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION
EPD_2in13_V4_SendData((Xstart>>3) & 0xFF);
EPD_2in13_V4_SendData((Xend>>3) & 0xFF);
EPD_2in13_V4_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION
EPD_2in13_V4_SendData(Ystart & 0xFF);
EPD_2in13_V4_SendData((Ystart >> 8) & 0xFF);
EPD_2in13_V4_SendData(Yend & 0xFF);
EPD_2in13_V4_SendData((Yend >> 8) & 0xFF);
}
/******************************************************************************
function : Set Cursor
parameter:
Xstart : X-axis starting position
Ystart : Y-axis starting position
******************************************************************************/
static void EPD_2in13_V4_SetCursor(UWORD Xstart, UWORD Ystart)
{
EPD_2in13_V4_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER
EPD_2in13_V4_SendData(Xstart & 0xFF);
EPD_2in13_V4_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER
EPD_2in13_V4_SendData(Ystart & 0xFF);
EPD_2in13_V4_SendData((Ystart >> 8) & 0xFF);
}
/******************************************************************************
function : Turn On Display
parameter:
******************************************************************************/
static void EPD_2in13_V4_TurnOnDisplay(void)
{
EPD_2in13_V4_SendCommand(0x22); // Display Update Control
EPD_2in13_V4_SendData(0xf7);
EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence
EPD_2in13_V4_ReadBusy();
}
static void EPD_2in13_V4_TurnOnDisplay_Fast(void)
{
EPD_2in13_V4_SendCommand(0x22); // Display Update Control
EPD_2in13_V4_SendData(0xc7); // fast:0x0c, quality:0x0f, 0xcf
EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence
EPD_2in13_V4_ReadBusy();
}
static void EPD_2in13_V4_TurnOnDisplay_Partial(void)
{
EPD_2in13_V4_SendCommand(0x22); // Display Update Control
EPD_2in13_V4_SendData(0xff); // fast:0x0c, quality:0x0f, 0xcf
EPD_2in13_V4_SendCommand(0x20); // Activate Display Update Sequence
EPD_2in13_V4_ReadBusy();
}
/******************************************************************************
function : Initialize the e-Paper register
parameter:
******************************************************************************/
void EPD_2in13_V4_Init(void)
{
EPD_2in13_V4_Reset();
EPD_2in13_V4_ReadBusy();
EPD_2in13_V4_SendCommand(0x12); //SWRESET
EPD_2in13_V4_ReadBusy();
EPD_2in13_V4_SendCommand(0x01); //Driver output control
EPD_2in13_V4_SendData(0xF9);
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendCommand(0x11); //data entry mode
EPD_2in13_V4_SendData(0x03);
EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1);
EPD_2in13_V4_SetCursor(0, 0);
EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom
EPD_2in13_V4_SendData(0x05);
EPD_2in13_V4_SendCommand(0x21); // Display update control
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendData(0x80);
EPD_2in13_V4_SendCommand(0x18); //Read built-in temperature sensor
EPD_2in13_V4_SendData(0x80);
EPD_2in13_V4_ReadBusy();
}
void EPD_2in13_V4_Init_Fast(void)
{
EPD_2in13_V4_Reset();
EPD_2in13_V4_SendCommand(0x12); //SWRESET
EPD_2in13_V4_ReadBusy();
EPD_2in13_V4_SendCommand(0x18); //Read built-in temperature sensor
EPD_2in13_V4_SendData(0x80);
EPD_2in13_V4_SendCommand(0x11); //data entry mode
EPD_2in13_V4_SendData(0x03);
EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1);
EPD_2in13_V4_SetCursor(0, 0);
EPD_2in13_V4_SendCommand(0x22); // Load temperature value
EPD_2in13_V4_SendData(0xB1);
EPD_2in13_V4_SendCommand(0x20);
EPD_2in13_V4_ReadBusy();
EPD_2in13_V4_SendCommand(0x1A); // Write to temperature register
EPD_2in13_V4_SendData(0x64);
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendCommand(0x22); // Load temperature value
EPD_2in13_V4_SendData(0x91);
EPD_2in13_V4_SendCommand(0x20);
EPD_2in13_V4_ReadBusy();
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void EPD_2in13_V4_Clear(void)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
EPD_2in13_V4_SendCommand(0x24);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(0XFF);
}
}
EPD_2in13_V4_TurnOnDisplay();
}
void EPD_2in13_V4_Clear_Black(void)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
EPD_2in13_V4_SendCommand(0x24);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(0X00);
}
}
EPD_2in13_V4_TurnOnDisplay();
}
/******************************************************************************
function : Sends the image buffer in RAM to e-Paper and displays
parameter:
Image : Image data
******************************************************************************/
void EPD_2in13_V4_Display(UBYTE *Image)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
EPD_2in13_V4_SendCommand(0x24);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(Image[i + j * Width]);
}
}
EPD_2in13_V4_TurnOnDisplay();
}
void EPD_2in13_V4_Display_Fast(UBYTE *Image)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
EPD_2in13_V4_SendCommand(0x24);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(Image[i + j * Width]);
}
}
EPD_2in13_V4_TurnOnDisplay_Fast();
}
/******************************************************************************
function : Refresh a base image
parameter:
Image : Image data
******************************************************************************/
void EPD_2in13_V4_Display_Base(UBYTE *Image)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
EPD_2in13_V4_SendCommand(0x24); //Write Black and White image to RAM
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(Image[i + j * Width]);
}
}
EPD_2in13_V4_SendCommand(0x26); //Write Black and White image to RAM
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(Image[i + j * Width]);
}
}
EPD_2in13_V4_TurnOnDisplay();
}
/******************************************************************************
function : Sends the image buffer in RAM to e-Paper and partial refresh
parameter:
Image : Image data
******************************************************************************/
void EPD_2in13_V4_Display_Partial(UBYTE *Image)
{
UWORD Width, Height;
Width = (EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1);
Height = EPD_2in13_V4_HEIGHT;
//Reset
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(1);
DEV_Digital_Write(EPD_RST_PIN, 1);
EPD_2in13_V4_SendCommand(0x3C); //BorderWavefrom
EPD_2in13_V4_SendData(0x80);
EPD_2in13_V4_SendCommand(0x01); //Driver output control
EPD_2in13_V4_SendData(0xF9);
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendData(0x00);
EPD_2in13_V4_SendCommand(0x11); //data entry mode
EPD_2in13_V4_SendData(0x03);
EPD_2in13_V4_SetWindows(0, 0, EPD_2in13_V4_WIDTH-1, EPD_2in13_V4_HEIGHT-1);
EPD_2in13_V4_SetCursor(0, 0);
EPD_2in13_V4_SendCommand(0x24); //Write Black and White image to RAM
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_2in13_V4_SendData(Image[i + j * Width]);
}
}
EPD_2in13_V4_TurnOnDisplay_Partial();
}
/******************************************************************************
function : Enter sleep mode
parameter:
******************************************************************************/
void EPD_2in13_V4_Sleep(void)
{
EPD_2in13_V4_SendCommand(0x10); //enter deep sleep
EPD_2in13_V4_SendData(0x01);
DEV_Delay_ms(100);
}

View File

@@ -31,7 +31,7 @@
#ifndef __EPD_2in13_V4_H_
#define __EPD_2in13_V4_H_
#include "Config/DEV_Config.h"
#include "../Config/DEV_Config.h"
// Display resolution

View File

@@ -1,56 +0,0 @@
//
// Created by steven on 11/14/2024.
//
//#include <time.h>
//#include <stdlib.h>
#include "libs/include/SDL2/SDL.h"
#include <stdio.h>
//#include "libs/EPD_2in13_V4.h"
//#include "libs/GUI/GUI_Paint.h"
//#include "libs/GUI/GUI_BMPfile.h"
__declspec(dllexport) SDL_Window* createWindow() {
SDL_Window *win = SDL_CreateWindow("Hello SDL",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
250, 122, SDL_WINDOW_SHOWN);
if (!win) {
printf("SDL_CreateWindow Error: %s\n", SDL_GetError());
SDL_Quit();
return NULL;
}
return win;
}
__declspec(dllexport) SDL_Renderer* createRenderer(SDL_Window *win) {
SDL_Renderer *ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (!ren) {
SDL_DestroyWindow(win);
printf("SDL_CreateRenderer Error: %s\n", SDL_GetError());
SDL_Quit();
return NULL;
}
return ren;
}
__declspec(dllexport) int draw(SDL_Renderer *ren) {
SDL_SetRenderDrawColor(ren, 255, 255, 255, 255);
SDL_RenderClear(ren);
SDL_SetRenderDrawColor(ren, 0, 0, 0, 255);
SDL_RenderDrawLine(ren, 10, 10, 240, 112);
SDL_RenderDrawLine(ren, 240, 10, 10, 112);
SDL_RenderPresent(ren);
return 0;
}
__declspec(dllexport) int destroy(SDL_Renderer *ren, SDL_Window *win) {
if (!ren) {
SDL_DestroyRenderer(ren);
}
if (!win) {
SDL_DestroyWindow(win);
}
}

View File

@@ -1,18 +0,0 @@
//
// Created by steven on 11/14/2024.
//
#include "libs/include/SDL2/SDL.h"
#ifndef P2FA_P2FA_H
#define P2FA_P2FA_H
#endif //P2FA_P2FA_H
__declspec(dllexport) SDL_Window* createWindow();
__declspec(dllexport) SDL_Renderer* createRenderer(SDL_Window*);
__declspec(dllexport) int draw(SDL_Renderer*);
__declspec(dllexport) int destroy(SDL_Renderer*, SDL_Window*);

258
c/src/images.c Normal file
View File

@@ -0,0 +1,258 @@
//
// Created by steven on 11/19/2024.
//
#include "images.h"
const unsigned char gImage_2in13_2[4006] = { /*0X00,0X01,0X7A,0X00,0XFA,0X00,*/
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0E,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X03,0XF0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XF0,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X04,0X1E,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XF0,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XBF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X38,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XE0,0X1F,0XCF,0XFF,0XF8,0X00,0X00,0X3C,0X30,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X0F,0X9F,0XFF,0XF8,0X00,0X00,0X1E,0X31,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X07,0X9F,0XFF,0XF8,0X00,0X00,0X1F,0X33,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0X87,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0X86,0X1F,0XFF,0XF8,0X00,0X00,0X07,0XFF,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X86,0X1F,0XFF,0XF8,0X00,0X00,0X03,0XFF,0X80,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X84,0X3F,0XFF,0XF8,0X00,0X00,0X00,0XFC,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X80,0X7F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X80,0XFF,0XFF,0XF8,0X00,0X00,0X00,0XFC,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X80,0XFF,0XFF,0XF8,0X00,0X00,0X07,0XFF,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X81,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X83,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X83,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XCF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X87,0XFF,0XFF,0XF8,0X00,0X00,0X3E,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X87,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X1C,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X0E,0X00,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XF0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XFF,0XE0,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XFF,0XE0,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XFF,0XE0,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XFF,0XE0,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X7F,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X07,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3F,0XFF,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X70,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X70,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X83,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X70,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X70,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XE0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X38,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XF0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1C,0X3C,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X1E,0X3F,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X1E,0X1F,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X0C,0X0F,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X07,0X80,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X01,0XFF,0X80,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X03,0XFF,0XC0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0XE7,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X81,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X80,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X00,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X00,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X00,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X00,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X3F,0XFF,0XFF,0XF8,0X00,0X07,0X00,0XE0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X00,0X1F,0XFF,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XAF,0X80,0X7F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0X00,0X3F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0E,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0E,0X1E,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0E,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X78,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X01,0XF0,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X07,0XF0,0X60,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X84,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XF0,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X7F,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XF0,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X7F,0X1F,0XFF,0XF8,0X00,0X00,0X3E,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X38,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X38,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X30,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X30,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0X33,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X03,0XFF,0X80,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X01,0XFE,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0C,0X3F,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X01,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X1F,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3F,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X07,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X81,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X7F,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XF0,0X1F,0XFF,0XFF,0XF8,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X07,0XFF,0XFF,0XF8,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0X01,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XC0,0X7F,0XFF,0XF8,0X00,0X1F,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XF0,0X1F,0XFF,0XF8,0X00,0X1F,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFC,0X0F,0XFF,0XF8,0X00,0X1F,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XF0,0X1F,0XFF,0XF8,0X00,0X1F,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XC0,0X7F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0X01,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X07,0XFF,0XFF,0XF8,0X00,0X00,0X08,0X00,0X60,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XF8,0X1F,0XFF,0XFF,0XF8,0X00,0X00,0X1C,0X00,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XE0,0X7F,0XFF,0XFF,0XF8,0X00,0X00,0X1E,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X81,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X07,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X3F,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XE0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1E,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0X83,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC1,0X83,0X9F,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X03,0XFF,0X80,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0XFE,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X01,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X0F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X8F,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3F,0X80,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X87,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X83,0XC3,0XFF,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X3C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XE0,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XF8,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X0E,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X00,0XFF,0XFF,0XF8,0X00,0X00,0X0F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X3F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFE,0X1F,0XFF,0XF8,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFE,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X0E,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X1F,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X1F,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X1F,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X0E,0X1F,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X00,0X1F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X00,0X70,0X3F,0X80,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X01,0XFC,0X7F,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X03,0XFE,0X7F,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X07,0XFF,0XE0,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X07,0X87,0XE0,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0X1F,0XFF,0XF8,0X00,0X0F,0X03,0XC0,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFE,0X1F,0XFF,0XF8,0X00,0X0F,0X03,0XC0,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFE,0X1F,0XFF,0XF8,0X00,0X0F,0X03,0XC0,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X1F,0XFF,0XF8,0X00,0X07,0X03,0XC0,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X3F,0XFF,0XF8,0X00,0X07,0X80,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X80,0X00,0X7F,0XFF,0XF8,0X00,0X07,0X80,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X03,0XC0,0X01,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X03,0X80,0X01,0XE0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0XC0,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFC,0X00,0X00,0X0F,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XC0,0X00,0X00,0X07,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0X00,0X00,0X00,0X07,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFC,0X00,0X1C,0X00,0X07,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XF8,0X00,0X7E,0X00,0X07,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XE0,0X01,0XFF,0X80,0X07,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XC0,0X07,0XFF,0XF8,0X07,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0XC0,0X1F,0XFF,0XFC,0X07,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0X80,0X3F,0XE1,0XFC,0X07,0XF8,0X00,0X07,0XFF,0XFF,0XF0,0X00,0X00,0X00,
0XFF,0XFF,0X00,0X3F,0XC0,0X7E,0X07,0XF8,0X00,0X03,0X80,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFE,0X00,0X3F,0XF0,0X7F,0X07,0XF8,0X00,0X03,0X80,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFE,0X00,0X1F,0XFC,0X00,0X07,0XF8,0X00,0X03,0X80,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFE,0X00,0X07,0XFF,0X00,0X07,0XF8,0X00,0X03,0X80,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFC,0X00,0X00,0XFF,0X80,0X07,0XF8,0X00,0X00,0X00,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFC,0X1F,0XE0,0X3F,0X80,0X07,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFC,0X0F,0XF0,0X3F,0X80,0X07,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XF8,0X07,0XFC,0XEF,0X80,0X07,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XF8,0X03,0XFF,0X98,0X00,0X07,0XF8,0X00,0X00,0X00,0X00,0XE0,0X00,0X00,0X00,
0XFF,0XF8,0X01,0XFF,0XF0,0X00,0X07,0XF8,0X00,0X00,0X00,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X9F,0XFC,0X00,0X07,0XF8,0X00,0X00,0X00,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X07,0XFF,0X00,0X07,0XF8,0X00,0X00,0X00,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0XFF,0X80,0X07,0XF8,0X00,0X00,0X00,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0XFF,0X80,0X07,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X07,0XFF,0X80,0X0F,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XFC,0X00,0X0F,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XF0,0X00,0X0F,0XF8,0X00,0X00,0X00,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XC0,0X00,0X0F,0XF8,0X00,0X00,0XFE,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XF8,0X00,0X1F,0XF8,0X00,0X03,0XFF,0X80,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X07,0XFE,0X00,0X1F,0XF8,0X00,0X03,0XFF,0XE0,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0XFF,0X80,0X3F,0XF8,0X00,0X07,0XFF,0XF0,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X01,0XFF,0X80,0X3F,0XF8,0X00,0X07,0X81,0XF8,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X1F,0XFF,0X80,0X7F,0XF8,0X00,0X0F,0X00,0X7E,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XFF,0X00,0XFF,0XF8,0X00,0X0F,0X00,0X3F,0X70,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XF8,0X01,0XFF,0XF8,0X00,0X0F,0X00,0X1F,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3F,0XC0,0X01,0XFF,0XF8,0X00,0X07,0X00,0X0F,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X3E,0X00,0X07,0XFF,0XF8,0X00,0X07,0X00,0X07,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X30,0X00,0X0F,0XFF,0XF8,0X00,0X07,0X80,0X03,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0X00,0X3F,0XFF,0XF8,0X00,0X03,0XC0,0X01,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0X00,0XFF,0XFF,0XF8,0X00,0X03,0XC0,0X00,0XF0,0X00,0X00,0X00,
0XFF,0XF8,0X00,0X00,0X07,0XFF,0XFF,0XF8,0X00,0X01,0X80,0X00,0X70,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

10
c/src/images.h Normal file
View File

@@ -0,0 +1,10 @@
//
// Created by steven on 11/19/2024.
//
#ifndef IMAGES_H
#define IMAGES_H
extern const unsigned char gImage_2in13_2[];
#endif //IMAGES_H

164
c/src/p2fa.c Normal file
View File

@@ -0,0 +1,164 @@
//
// Created by steven on 11/14/2024.
//
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include "images.h"
#include "../libs/e-Paper/EPD_2in13_V4.h"
#include "../libs/GUI/GUI_Paint.h"
#include "../libs/GUI/GUI_BMPfile.h"
void Handler(int sigNum) {
printf("Caught signal %d\n", sigNum);
DEV_Module_Exit();
exit(0);
}
__declspec(dllexport) void init() {
signal(SIGINT, Handler);
}
__declspec(dllexport) int draw() {
Debug("EPD_2in13_V4_test Demo\r\n");
if(DEV_Module_Init()!=0){
return -1;
}
Debug("e-Paper Init and Clear...\r\n");
EPD_2in13_V4_Init();
struct timespec start={0,0}, finish={0,0};
clock_gettime(CLOCK_REALTIME,&start);
EPD_2in13_V4_Clear();
clock_gettime(CLOCK_REALTIME,&finish);
Debug("%ld S\r\n",finish.tv_sec-start.tv_sec);
//Create a new image cache
UBYTE *BlackImage;
UWORD Imagesize = ((EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1)) * EPD_2in13_V4_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
Debug("Failed to apply for black memory...\r\n");
return -1;
}
Debug("Paint_NewImage\r\n");
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Paint_Clear(WHITE);
#if 1 // show bmp
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Debug("show window BMP-----------------\r\n");
Paint_SelectImage(BlackImage);
GUI_ReadBmp("./pic/100x100.bmp", 10, 10);
EPD_2in13_V4_Display(BlackImage);
DEV_Delay_ms(3000);
Debug("show bmp------------------------\r\n");
Paint_SelectImage(BlackImage);
GUI_ReadBmp("./pic/2in13_1.bmp", 0, 0);
EPD_2in13_V4_Display(BlackImage);
DEV_Delay_ms(3000);
#endif
#if 1 //show image for array
Debug("show image for array\r\n");
EPD_2in13_V4_Init_Fast();
Paint_SelectImage(BlackImage);
Paint_Clear(WHITE);
Paint_DrawBitMap(gImage_2in13_2);
EPD_2in13_V4_Display_Fast(BlackImage);
DEV_Delay_ms(2000);
#endif
#if 1 // Drawing on the image
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Debug("Drawing\r\n");
//1.Select Image
EPD_2in13_V4_Init();
Paint_SelectImage(BlackImage);
Paint_Clear(WHITE);
// 2.Drawing on the image
Paint_DrawPoint(5, 10, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
Paint_DrawPoint(5, 25, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
Paint_DrawPoint(5, 40, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
Paint_DrawPoint(5, 55, BLACK, DOT_PIXEL_4X4, DOT_STYLE_DFT);
Paint_DrawLine(20, 10, 70, 60, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawLine(70, 10, 20, 60, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
Paint_DrawRectangle(20, 10, 70, 60, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawRectangle(85, 10, 135, 60, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawLine(45, 15, 45, 55, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawLine(25, 35, 70, 35, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
Paint_DrawCircle(45, 35, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
Paint_DrawCircle(110, 35, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
Paint_DrawString(140, 15, "waveshare", &Font16, BLACK, WHITE);
Paint_DrawNum(140, 40, 123456789, &Font16, BLACK, WHITE);
Paint_DrawString(140, 60, "waveshare", &Font12, BLACK, WHITE);
Paint_DrawString(5, 65, "string", &Font24, WHITE, BLACK);
EPD_2in13_V4_Display_Base(BlackImage);
DEV_Delay_ms(3000);
#endif
#if 1 //Partial refresh, example shows time
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Debug("Partial refresh\r\n");
Paint_SelectImage(BlackImage);
PAINT_TIME sPaint_time;
sPaint_time.Hour = 12;
sPaint_time.Min = 34;
sPaint_time.Sec = 56;
UBYTE num = 10;
for (;;) {
sPaint_time.Sec = sPaint_time.Sec + 1;
if (sPaint_time.Sec == 60) {
sPaint_time.Min = sPaint_time.Min + 1;
sPaint_time.Sec = 0;
if (sPaint_time.Min == 60) {
sPaint_time.Hour = sPaint_time.Hour + 1;
sPaint_time.Min = 0;
if (sPaint_time.Hour == 24) {
sPaint_time.Hour = 0;
sPaint_time.Min = 0;
sPaint_time.Sec = 0;
}
}
}
Paint_ClearWindows(150, 80, 150 + Font20.Width * 7, 80 + Font20.Height, WHITE);
Paint_DrawTime(150, 80, &sPaint_time, &Font20, WHITE, BLACK);
num = num - 1;
if(num == 0) {
break;
}
EPD_2in13_V4_Display_Partial(BlackImage);
DEV_Delay_ms(500);//Analog clock 1s
}
#endif
Debug("Clear...\r\n");
EPD_2in13_V4_Init();
EPD_2in13_V4_Clear();
Debug("Goto Sleep...\r\n");
EPD_2in13_V4_Sleep();
free(BlackImage);
BlackImage = NULL;
DEV_Delay_ms(2000);//important, at least 2s
// close 5V
Debug("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit();
return 0;
return 0;
}

12
c/src/p2fa.h Normal file
View File

@@ -0,0 +1,12 @@
//
// Created by steven on 11/14/2024.
//
#ifndef P2FA_P2FA_H
#define P2FA_P2FA_H
#endif //P2FA_P2FA_H
__declspec(dllexport) void init();
__declspec(dllexport) int draw();