Skip to content

Commit

Permalink
added ability to call Init() from the application in case interrupts …
Browse files Browse the repository at this point in the history
…are disabled.
  • Loading branch information
ErichStyger committed Jan 20, 2014
1 parent 1a37d5c commit ff83805
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 87 deletions.
72 changes: 59 additions & 13 deletions Beans/PDC8544/PDC8544.bean
Expand Up @@ -4,7 +4,7 @@
<Name>PDC8544</Name>
<Description>Display driver for the Philips PDC8544 display driver</Description>
<Author>Erich Styger</Author>
<Version>01.001</Version>
<Version>01.003</Version>
<Icon>PDC8544</Icon>
<TypesFiles>PE,PDC8544\PDC8544</TypesFiles>
<FileVersion>6</FileVersion>
Expand All @@ -20,7 +20,7 @@
<BW_NeedUst>3</BW_NeedUst>
<BW_NeedCns>0</BW_NeedCns>
<BeanStatus>PROPOSAL</BeanStatus>
<Copyright>License : Open Source (LGPL)\nCopyright : (c) Copyright Erich Styger, 2012, all rights reserved.\n\nThis an open source software in the form of a Processor Expert Embedded Component.\nThis is a free software and is opened for education, research and commercial developments under license policy of following terms:\n* This is a free software and there is NO WARRANTY.\n* No restriction on use. You can use, modify and redistribute it for personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.\n* Redistributions of source code must retain the above copyright notice.</Copyright>
<Copyright>License : Open Source (LGPL)\nCopyright : (c) Copyright Erich Styger, 2014, all rights reserved.\n\nThis an open source software in the form of a Processor Expert Embedded Component.\nThis is a free software and is opened for education, research and commercial developments under license policy of following terms:\n* This is a free software and there is NO WARRANTY.\n* No restriction on use. You can use, modify and redistribute it for personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.\n* Redistributions of source code must retain the above copyright notice.</Copyright>
<Shortcut>PDC</Shortcut>
<DemoDriver>no</DemoDriver>
<BeanLevel>Low</BeanLevel>
Expand Down Expand Up @@ -515,6 +515,24 @@
<SortStyle/>
</TInhrLinkItem>
</GrupItem>
<GrupItem>
<TBoolItem>
<Name>Initialize on Init</Name>
<Symbol>InitializeOnInit</Symbol>
<TypeSpec>typeYesNo</TypeSpec>
<Hint>If set to 'yes', it will initialize the driver during startup in PE_low_level_init() inside main(). If set to 'no', it is your responsibility to call the component Init() method.</Hint>
<ItemLevel>BASIC</ItemLevel>
<EditLine>false</EditLine>
<TypeSpecNameChangeAble>false</TypeSpecNameChangeAble>
<DefaultIndex>0</DefaultIndex>
<TextValueIndex>false</TextValueIndex>
<RuntimeProperty>false</RuntimeProperty>
<CanDelete>false</CanDelete>
<IconPopup>false</IconPopup>
<DefaultValue>true</DefaultValue>
<Popup>false</Popup>
</TBoolItem>
</GrupItem>
</Children>
</TGrupItem>
</Property>
Expand Down Expand Up @@ -1174,10 +1192,10 @@
</Method>
<Method>
<TMthdItem>
<Name>Init</Name>
<Symbol>Init</Symbol>
<Name>GetLCD</Name>
<Symbol>GetLCD</Symbol>
<TypeSpec>typeMethod</TypeSpec>
<Hint>Display driver initialization</Hint>
<Hint>Method to be called for mutual exclusive access to the LCD</Hint>
<ItemLevel>BASIC</ItemLevel>
<EditLine>false</EditLine>
<TypeSpecNameChangeAble>false</TypeSpecNameChangeAble>
Expand All @@ -1188,11 +1206,11 @@
<IconPopup>false</IconPopup>
<DefaultValue>true</DefaultValue>
<Popup>false</Popup>
<PublicMethod>false</PublicMethod>
<PublicMethod>true</PublicMethod>
<IsAssembler>false</IsAssembler>
<InDefinition>true</InDefinition>
<ReturnType>void</ReturnType>
<RetHint>Error code</RetHint>
<RetHint>none</RetHint>
<ParamCount>0</ParamCount>
<Scope>PRIVATE</Scope>
<Declarations>
Expand All @@ -1202,8 +1220,8 @@
</Method>
<Method>
<TMthdItem>
<Name>GetLCD</Name>
<Symbol>GetLCD</Symbol>
<Name>GiveLCD</Name>
<Symbol>GiveLCD</Symbol>
<TypeSpec>typeMethod</TypeSpec>
<Hint>Method to be called for mutual exclusive access to the LCD</Hint>
<ItemLevel>BASIC</ItemLevel>
Expand All @@ -1230,10 +1248,10 @@
</Method>
<Method>
<TMthdItem>
<Name>GiveLCD</Name>
<Symbol>GiveLCD</Symbol>
<Name>Init</Name>
<Symbol>Init</Symbol>
<TypeSpec>typeMethod</TypeSpec>
<Hint>Method to be called for mutual exclusive access to the LCD</Hint>
<Hint>Display driver initialization</Hint>
<ItemLevel>BASIC</ItemLevel>
<EditLine>false</EditLine>
<TypeSpecNameChangeAble>false</TypeSpecNameChangeAble>
Expand All @@ -1248,7 +1266,35 @@
<IsAssembler>false</IsAssembler>
<InDefinition>true</InDefinition>
<ReturnType>void</ReturnType>
<RetHint>none</RetHint>
<RetHint>Error code</RetHint>
<ParamCount>0</ParamCount>
<Scope>PRIVATE</Scope>
<Declarations>
<ANSIC>void #M#_#C#(void)</ANSIC>
</Declarations>
</TMthdItem>
</Method>
<Method>
<TMthdItem>
<Name>Deinit</Name>
<Symbol>Deinit</Symbol>
<TypeSpec>typeMethod</TypeSpec>
<Hint>Module Deinitialization</Hint>
<ItemLevel>BASIC</ItemLevel>
<EditLine>false</EditLine>
<TypeSpecNameChangeAble>false</TypeSpecNameChangeAble>
<DefaultIndex>0</DefaultIndex>
<TextValueIndex>false</TextValueIndex>
<RuntimeProperty>false</RuntimeProperty>
<CanDelete>false</CanDelete>
<IconPopup>false</IconPopup>
<DefaultValue>true</DefaultValue>
<Popup>false</Popup>
<PublicMethod>true</PublicMethod>
<IsAssembler>false</IsAssembler>
<InDefinition>true</InDefinition>
<ReturnType>void</ReturnType>
<RetHint>Error code</RetHint>
<ParamCount>0</ParamCount>
<Scope>PRIVATE</Scope>
<Declarations>
Expand Down
2 changes: 1 addition & 1 deletion Beans/PDC8544/PDC8544.uis
@@ -1,6 +1,6 @@

[USED_FACES]
BeanVersion=01.001
BeanVersion=01.003

InterfacesCount=9

Expand Down
18 changes: 18 additions & 0 deletions Beans/PDC8544/PDC8544Methods.html
Expand Up @@ -405,6 +405,24 @@
<br /><i>ANSIC prototype:</i> void GiveLCD(void)<br />
<!---VER_SPEC_END DON'T CHANGE THIS LINE-->
</ul><br />
</li>
<li><a name="Init">
<b>Init</b></a>
- Display driver initialization
<ul>
<!---VER_SPEC #ANSIC# DON'T CHANGE THIS LINE-->
<br /><i>ANSIC prototype:</i> void Init(void)<br />
<!---VER_SPEC_END DON'T CHANGE THIS LINE-->
</ul><br />
</li>
<li><a name="Deinit">
<b>Deinit</b></a>
- Module Deinitialization
<ul>
<!---VER_SPEC #ANSIC# DON'T CHANGE THIS LINE-->
<br /><i>ANSIC prototype:</i> void Deinit(void)<br />
<!---VER_SPEC_END DON'T CHANGE THIS LINE-->
</ul><br />
</li>

</ul>
Expand Down
4 changes: 4 additions & 0 deletions Beans/PDC8544/PDC8544Properties.html
Expand Up @@ -370,6 +370,10 @@
<a name="Wait">
<b>Wait</b></a> - Interface for busy waiting.
</li>
<li>
<a name="InitializeOnInit">
<b>Initialize on Init</b></a> - If set to 'yes', it will initialize the driver during startup in PE_low_level_init() inside main(). If set to 'no', it is your responsibility to call the component Init() method.
</li>
</ul>
</li>

Expand Down
15 changes: 15 additions & 0 deletions Drivers/Common/PDC8544Deinit.Inc
@@ -0,0 +1,15 @@
%- AUTOREGENERATE If you remove this line, this file cannot be rewrited (by default)
%ifndef CommentLine
%{
%endif CommentLine
%;** ===================================================================
%include Common\GeneralMethod.inc (Deinit)
%;** Description :
%;** Module Deinitialization
%include Common\GeneralParametersNone.inc
%include Common\GeneralReturnNothing.inc
%include Common\GeneralDamage.inc
%;** ===================================================================
%ifndef CommentLine
%}
%endif CommentLine
15 changes: 15 additions & 0 deletions Drivers/Common/PDC8544Init.Inc
@@ -0,0 +1,15 @@
%- AUTOREGENERATE If you remove this line, this file cannot be rewrited (by default)
%ifndef CommentLine
%{
%endif CommentLine
%;** ===================================================================
%include Common\GeneralMethod.inc (Init)
%;** Description :
%;** Display driver initialization
%include Common\GeneralParametersNone.inc
%include Common\GeneralReturnNothing.inc
%include Common\GeneralDamage.inc
%;** ===================================================================
%ifndef CommentLine
%}
%endif CommentLine
50 changes: 41 additions & 9 deletions Drivers/sw/PDC8544.drv
Expand Up @@ -51,7 +51,6 @@
%- List of descriptions of internal methods
%define! Description_WriteCmd Writes a command to the display
%define! Description_WriteData Write a data byte to the display
%define! Description_Init Display driver initialization
%ifdef SPILDD
%ifdef @SPILDD@OnBlockReceived
%define! Description_%@SPILDD@OnBlockReceived This event is called when the requested number of data is moved to the input buffer. This method is available only if the ReceiveBlock method is enabled. The event services the event of the inherited component and eventually invokes other events.
Expand Down Expand Up @@ -230,11 +229,13 @@ void %'ModuleName'%.%ClearLine(byte lineNumber);
%endif %- ClearLine
%-BW_METHOD_END ClearLine
%-************************************************************************************************************
%-INTERNAL_METHOD_BEG Init
void %'ModuleName'%.Init(void);
%include Common\GeneralInternal.inc (Init)
%-BW_METHOD_BEGIN Init
%ifdef Init
void %'ModuleName'%.%Init(void);
%include Common\PDC8544Init.Inc

%-INTERNAL_METHOD_END Init
%endif %- Init
%-BW_METHOD_END Init
%-************************************************************************************************************
%-BW_METHOD_BEGIN WriteChar
%ifdef WriteChar
Expand Down Expand Up @@ -397,6 +398,14 @@ void %@SPILDD@OnBlockReceived(LDD_TUserData *UserDataPtr);

%endif %- @SPILDD@OnBlockReceived
%-INHERITED_EVENT_END SPILDD OnBlockReceived
%-************************************************************************************************************
%-BW_METHOD_BEGIN Deinit
%ifdef Deinit
void %'ModuleName'%.%Deinit(void);
%include Common\PDC8544Deinit.Inc

%endif %- Deinit
%-BW_METHOD_END Deinit
%-BW_DEFINITION_END
/* END %ModuleName. */

Expand Down Expand Up @@ -728,9 +737,10 @@ void %'ModuleName'%.%ClearLine(byte lineNumber)
%endif %- ClearLine
%-BW_METHOD_END ClearLine
%-************************************************************************************************************
%-INTERNAL_METHOD_BEG Init
%include Common\GeneralInternal.inc (Init)
void %'ModuleName'%.Init(void)
%-BW_METHOD_BEGIN Init
%ifdef Init
%include Common\PDC8544Init.Inc
void %'ModuleName'%.%Init(void)
{
%if defined(RESLDD)
RES_DeviceData = %@RESLDD@'ModuleName'%.Init(NULL); /* device handle for RES pin */
Expand Down Expand Up @@ -775,7 +785,8 @@ void %'ModuleName'%.Init(void)
%'ModuleName'%.%SetPos(0,0); %>40 /* Cursor Home */
}

%-INTERNAL_METHOD_END Init
%endif %- Init
%-BW_METHOD_END Init
%-************************************************************************************************************
%-BW_METHOD_BEGIN WriteChar
%ifdef WriteChar
Expand Down Expand Up @@ -1036,6 +1047,25 @@ void %@SPILDD@OnBlockReceived(LDD_TUserData *UserDataPtr)

%endif %- @SPILDD@OnBlockReceived
%-INHERITED_EVENT_END SPILDD OnBlockReceived
%-************************************************************************************************************
%-BW_METHOD_BEGIN Deinit
%ifdef Deinit
%include Common\PDC8544Deinit.Inc
void %'ModuleName'%.%Deinit(void)
{
%if defined(RESLDD)
%@RESLDD@'ModuleName'%.Deinit(RES_DeviceData); /* device handle for RES pin */
%endif
%if defined(SCELDD)
%@SCELDD@'ModuleName'%.Deinit(SCE_DeviceData); /* device handle for SCE pin */
%endif
%if defined(D_CLDD)
%@D_CLDD@'ModuleName'%.Deinit(D_C_DeviceData); /* device handle for D_C pin */
%endif
}

%endif %- Deinit
%-BW_METHOD_END Deinit
%-BW_IMPLEMENT_END
/* END %ModuleName. */

Expand All @@ -1059,7 +1089,9 @@ void %OnBlockReceived(LDD_TUserData *UserDataPtr)
%INITIALIZATION
/* ### %DeviceType "%DeviceName" init code ... */
%CODE_BEGIN
%if %InitializeOnInit='yes'
%'ModuleName'%.Init();
%endif
%CODE_END
%-
%ENABLE
Expand Down
6 changes: 3 additions & 3 deletions Examples/FRDM-KL25Z/Freedom_Nokia/.cproject
Expand Up @@ -11,14 +11,13 @@
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.freescale.core.ide.cdt.errorParsers.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="Freedom_Nokia" buildArtefactType="org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildReferences="true" buildReferencingConfigurations="false" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser;com.freescale.core.ide.cdt.errorParsers.GCCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.531983507" isPrebuildInvalidatingBuild="false" name="FLASH" parent="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep="" produceBuildErrorsWithMissingReferences="true">
<configuration artifactName="Freedom_Nokia" buildArtefactType="org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildReferences="true" buildReferencingConfigurations="false" description="" errorParsers="org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser;com.freescale.core.ide.cdt.errorParsers.GCCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.531983507" isPrebuildInvalidatingBuild="false" name="FLASH" parent="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep="" produceBuildErrorsWithMissingReferences="true">
<folderInfo id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.531983507." name="/" resourcePath="">
<toolChain errorParsers="" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.debug.1591397247" name="ARM Ltd Windows GCC (G++ Lite)" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level.710813573" name="Debug level" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.debugging.level.max" valueType="enumerated"/>
Expand All @@ -28,7 +27,7 @@
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.addtools.printsize.389643766" name="Print Size" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.addtools.printsize" value="true" valueType="boolean"/>
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.toolchain.sharedoption.model.321718587" name="Model" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.toolchain.sharedoption.model" value="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.toolchain.sharedoption.model.ewl_c_noio" valueType="enumerated"/>
<targetPlatform binaryParser="org.eclipse.cdt.core.GNU_ELF" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.debug.1940517343" isAbstract="false" name="Windows Platform" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.debug"/>
<builder buildPath="${ProjDirPath}/FLASH" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug.494870692" keepEnvironmentInBuildfile="false" name="ARM Ltd Windows GNU Make builder" parallelBuildWorkspaceOn="true" parallelizationNumber="-1" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug"/>
<builder buildPath="${ProjDirPath}/FLASH" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug.494870692" keepEnvironmentInBuildfile="false" name="ARM Ltd Windows GNU Make builder" parallelBuildOn="true" parallelBuildWorkspaceOn="true" parallelizationNumber="-1" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug"/>
<tool command="arm-none-eabi-gcc" commandLinePattern="&quot;${ARMSourceryDir}/${COMMAND}&quot; ${INPUTS} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT}" errorParsers="com.freescale.core.ide.cdt.errorParsers.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.debug.11569975" name="ARM Ltd Windows GCC Assembler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.assembler.option.include.paths.1166411365" name="Include paths (-I)" superClass="org.eclipse.cdt.cross.arm.gnu.assembler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/Generated_Code&quot;"/>
Expand Down Expand Up @@ -119,4 +118,5 @@
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Freedom_Nokia"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>
1 change: 0 additions & 1 deletion Examples/FRDM-KL25Z/Freedom_Nokia/.project
Expand Up @@ -12,7 +12,6 @@
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
Expand Down
@@ -1,4 +1,3 @@
#Sun Aug 25 19:16:01 CEST 2013
eclipse.preferences.version=1
hotfix/arm.cdt.toolchain.ErrorParserHotFix=true
hotfix/arm.cdt.toolchain.UIElementValueTypeUpdate=true
Expand All @@ -7,13 +6,17 @@ hotfix/class\ com.freescale.core.ide.cdt.toolchain.QuotePathsHotFix=true
hotfix/class\ com.freescale.core.ide.cdt.toolchain.ToolOptionsUpdateHotFix=true
hotfix/class\ com.freescale.core.ide.cdt.toolchain.UiElementValueTypeHotFix=true
hotfix/coldfire.cdt.toolchain.UIElementValueTypeUpdate=true
hotfix/com.freescale.arm.cdt.toolchain=true
hotfix/com.freescale.arm.cdt.toolchain.ToolOptionsUpdate.fileAndProgram_v1=true
hotfix/com.freescale.coldfire.cdt.gcc.toolchain=true
hotfix/com.freescale.coldfire.cdt.toolchain=true
hotfix/com.freescale.coldfire.toolchain.ToolOptionsUpdate.fileAndProgram_v1=true
hotfix/com.freescale.core.ide.util.pbhotfix=true
hotfix/com.freescale.dsc.cdt.toolchain=true
hotfix/com.freescale.hc08.cdt.toolchain=true
hotfix/com.freescale.hc08.cdt.toolchain.FixCommandLinePatternHotFix=true
hotfix/com.freescale.hc08.cdt.toolchain.hc08.cdt.toolchain.UIElementValueTypeUpdate=true
hotfix/com.freescale.s12z.cdt.toolchain=true
hotfix/com.freescale.s12z.cdt.toolchain.LibOptionsHotFix=true
hotfix/dsc.cdt.toolchain.UIElementValueTypeUpdate=true
hotfix/s12z.cdt.toolchain.UIElementValueTypeUpdate=true

0 comments on commit ff83805

Please sign in to comment.