I am developing a battery driver. Since this battery driver has to go
through a I2C bus to get info from a battery monitoring chip, I need to call
a I2C bus driver.
This I2C driver uses standard file interface (CreateFile, DeviceIOControl,
etc). When I calls CreateFile(...) to open this I2C driver, I got error
saying "device not exist". Does WINCE5.0 allow such calling? If it does, can
someone advise what I should check?
Thanks a lot.
Fan

Re: one device driver calling another device driver? by Voidcoder

Voidcoder
Thu Aug 25 16:35:08 CDT 2005

Yes, You can do it this way. Check to see if the driver You are
trying to open is really loaded. Take a look at HKLM\Drivers\Active,
it must be listed there. And post Your "CreateFile" code,
probably something is wrong with parameters.

"Fan" <lingfan@hotmail.com> wrote in message news:eyJwfvSqFHA.3724@TK2MSFTNGP12.phx.gbl...
>I am developing a battery driver. Since this battery driver has to go
> through a I2C bus to get info from a battery monitoring chip, I need to call
> a I2C bus driver.
> This I2C driver uses standard file interface (CreateFile, DeviceIOControl,
> etc). When I calls CreateFile(...) to open this I2C driver, I got error
> saying "device not exist". Does WINCE5.0 allow such calling? If it does, can
> someone advise what I should check?
> Thanks a lot.
> Fan
>
>



Re: one device driver calling another device driver? by Steve

Steve
Thu Aug 25 08:26:15 CDT 2005

You can do this, you need to make sure the driver load order for the I2C
driver is lower than the one for your battery. Set the "Order" value in the
drivers registry settings to make sure it loads and initializes first.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: one device driver calling another device driver? by Fan

Fan
Fri Aug 26 00:07:28 CDT 2005

Steve,
Thank you very much for the reply.
Both my battery driver and I2C driver have a "Order" value of "0". I changed
the "Order" value for battery to "1" in file platform.reg, then I did
"build current project" to rebuilt my battery driver dll and generate new OS
image. I checked the "Order" value for battery driver in file reginit.ini.
It is still "0", not changed!
What's the right way/place to change this value?
I am working on Wince5.0, PAX255 IDP board.
Thanks again.
Fan


"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:OEf1piXqFHA.1040@tk2msftngp13.phx.gbl...
> You can do this, you need to make sure the driver load order for the I2C
> driver is lower than the one for your battery. Set the "Order" value in
the
> drivers registry settings to make sure it loads and initializes first.
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>



Re: one device driver calling another device driver? by Olivier

Olivier
Fri Aug 26 02:20:57 CDT 2005

Ensure the "Copy Files to Release Directory" step is applied.
When you edit the configuration files "platform.reg" or "project.reg" in PB
IDE, you do not edit the files located in the release dir (which are the one
taken into account when doing the makeimage).
These files you edit are located in directories
"$(_WINCEROOT)\PLATFORM\MyPlatform\Files\platform.reg" and
"$(_WINCEROOT)\PBWorkspaces\MyOSDesign\WINCE500\MyOSDesign_ARMV4I\OAK\files\
project.reg". They are moved to releasedir at "Copy Files To Release Dir"
step.
What you can do is creating another .reg file located in your driver's
folder, containing all your driver specific reg configuration and add a
"#include" directive in the platform.reg file to include your reg file.
This way, you won't have to re-apply the "Copy Files To Release Dir" step
each time you modify your drivers reg settings.

--
________________________________________
Olivier BLOCH
Mobile and Embedded technologies engineer
THEORIS - www.theoris.fr



"Fan" <lingfan@hotmail.com> a écrit dans le message de
news:Oe8rxTgqFHA.272@TK2MSFTNGP15.phx.gbl...
> Steve,
> Thank you very much for the reply.
> Both my battery driver and I2C driver have a "Order" value of "0". I
changed
> the "Order" value for battery to "1" in file platform.reg, then I did
> "build current project" to rebuilt my battery driver dll and generate new
OS
> image. I checked the "Order" value for battery driver in file reginit.ini.
> It is still "0", not changed!
> What's the right way/place to change this value?
> I am working on Wince5.0, PAX255 IDP board.
> Thanks again.
> Fan
>



Re: one device driver calling another device driver? by Fan

Fan
Fri Aug 26 01:59:15 CDT 2005

It worked! Now my battery driver can successfully open I2C bus.
Thanks Olivier and thanks Steve.
Fan

"Olivier Bloch" <nospam@theoris.fr> wrote in message
news:eSOuV8gqFHA.3540@TK2MSFTNGP14.phx.gbl...
> Ensure the "Copy Files to Release Directory" step is applied.
> When you edit the configuration files "platform.reg" or "project.reg" in
PB
> IDE, you do not edit the files located in the release dir (which are the
one
> taken into account when doing the makeimage).
> These files you edit are located in directories
> "$(_WINCEROOT)\PLATFORM\MyPlatform\Files\platform.reg" and
>
"$(_WINCEROOT)\PBWorkspaces\MyOSDesign\WINCE500\MyOSDesign_ARMV4I\OAK\files\
> project.reg". They are moved to releasedir at "Copy Files To Release Dir"
> step.
> What you can do is creating another .reg file located in your driver's
> folder, containing all your driver specific reg configuration and add a
> "#include" directive in the platform.reg file to include your reg file.
> This way, you won't have to re-apply the "Copy Files To Release Dir" step
> each time you modify your drivers reg settings.
>
> --
> ________________________________________
> Olivier BLOCH
> Mobile and Embedded technologies engineer
> THEORIS - www.theoris.fr
>
>
>
> "Fan" <lingfan@hotmail.com> a écrit dans le message de
> news:Oe8rxTgqFHA.272@TK2MSFTNGP15.phx.gbl...
> > Steve,
> > Thank you very much for the reply.
> > Both my battery driver and I2C driver have a "Order" value of "0". I
> changed
> > the "Order" value for battery to "1" in file platform.reg, then I did
> > "build current project" to rebuilt my battery driver dll and generate
new
> OS
> > image. I checked the "Order" value for battery driver in file
reginit.ini.
> > It is still "0", not changed!
> > What's the right way/place to change this value?
> > I am working on Wince5.0, PAX255 IDP board.
> > Thanks again.
> > Fan
> >
>
>



Re: one device driver calling another device driver? by Nicolas

Nicolas
Fri Aug 26 04:15:17 CDT 2005

Try to ckeck the "Clean Before Building" option in the "Build OS" menu and
then click on " Copy Files to Release Directory" entry in the same menu
followed by "Make Runtime Image".
Then check your reginit.ini file.

Nicolas


--
Nicolas BESSON
ADENEO (ADESET)
Windows Embedded Consultant
nbesson AT adeneo DOT adetelgroup DOT com

Tel : +33 (0)4.72.18.08.40

"Fan" <lingfan@hotmail.com> wrote in message
news:Oe8rxTgqFHA.272@TK2MSFTNGP15.phx.gbl...
> Steve,
> Thank you very much for the reply.
> Both my battery driver and I2C driver have a "Order" value of "0". I
> changed
> the "Order" value for battery to "1" in file platform.reg, then I did
> "build current project" to rebuilt my battery driver dll and generate new
> OS
> image. I checked the "Order" value for battery driver in file reginit.ini.
> It is still "0", not changed!
> What's the right way/place to change this value?
> I am working on Wince5.0, PAX255 IDP board.
> Thanks again.
> Fan
>
>
> "Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
> news:OEf1piXqFHA.1040@tk2msftngp13.phx.gbl...
>> You can do this, you need to make sure the driver load order for the I2C
>> driver is lower than the one for your battery. Set the "Order" value in
> the
>> drivers registry settings to make sure it loads and initializes first.
>>
>> --
>> Steve Maillet
>> EmbeddedFusion
>> www.EmbeddedFusion.com
>> smaillet at EmbeddedFusion dot com
>>
>>
>
>



Re: one device driver calling another device driver? by Dean

Dean
Fri Aug 26 09:22:27 CDT 2005

Another option is to use the new API notification mechanism that was
introduced in 4.2. You can use events to indicate when a particular driver
has loaded and is ready to be used. It also can be used to determine if the
API is even present on the device (did the module get included in the
build). This mechanism is a little cleaner, and takes load order out of the
equation. See "Determining if an API is Ready" in PB help.

Note that while the documentation refers to various system APIs, you use the
same mechanism for your own APIs (I2C in this case).

--
Dean Ramsier - eMVP






Re: one device driver calling another device driver? by Steve

Steve
Fri Aug 26 09:46:12 CDT 2005

That doesn't work well with drivers depending on one another. Load order
works much better in my opinion. No code and simple registry entries. The
notification requires a separate thread in the driver as you can't wait in
the xxx_Init since a single thread in the device manager calls the xxx_Init
functions you will block all other drivers from loading. Notifications are a
significantly greater complication to solve a problem already solved by the
OS with a simple registry setting.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com