Re: PWM Driver

From: Geoff Smith (smith.geoffrey_at_fixme.comcast.net)
Date: 03/30/04


Date: Tue, 30 Mar 2004 14:22:42 -0800

David -
    Streams drivers are very common across several operating systems. The
API they expose allows them to be accessed via a file-like set of functions.
The MSDN and Platform Builder docs describe them quite well. RegisterDevice
has been replaced by ActivateDeviceEx. When you call this function your PWM
driver PWM_Init should get called.

CreateFile will call PWM_Open
WriteFile - PWM_Write
ReadFile - you get the picture.

The catch all is DeviceIoControl - you use this for everything not
applicable to the other stream APIs.

Points to note:
-Your ini function should be PWM_Init not PWM_INIT
-You should export your entry points in a DEF file
-You can load your driver at boot time using the HKLM\Builtin key
- Don't be afraid to read the MSDN and PB docs
- Consider attending a CE training course

-- 
Geoff Smith
eMVP
==
"David V" <davev@> wrote in message
news:%23GyDRTpFEHA.3540@TK2MSFTNGP09.phx.gbl...
> I am trying to write a dll for a PWM driver. I am using Platform Builder
4.2
> for the x-scale.
>
> When i try to register the dll I use the code below and get error type 1.
>  dll = RegisterDevice(L"PWM", 1, L"pwm.dll", 0);
>
>
> In my dll project I have a init function, PWM_INIT.
>
>
> What should the signature be for this function? I have seen 3 different
> signatures. One with 2 input parameters, One that returns a BOOL. One that
> returns a DWORD handle.
>
> What should the handle be if all i want to do I use PWM_IOControl?
>
> There don't seem to be an good examples on how to write a driver. All the
> examples are poorly commented and extremely confusing.
>
>
> Dave V.
>
>


Relevant Pages

  • Re: Digital-tv card drivers and API discussion
    ... Designing completely new api takes some time and I ... > driver development experience, I have a couple of questions for you. ... > 2) As linux kernel is GPL-licensed, I cannot just port the linux driver ... I'm able to watch DVB programs converted from MPEG TS substreams to MPEG ...
    (freebsd-arch)
  • Re: [2.6 patch] ieee1394_core.c: remove unneeded EXPORT_SYMBOLs
    ... distribution will call us and require intense support. ... profits with Linux sales - and 99.99 % of our income with Windows sales. ... I do not see the licensing issue of a stable kernel API where venders ... Our driver is GPL so there should no be a licensing issue. ...
    (Linux-Kernel)
  • Re: checking and Copying a file when system is Loading
    ... DAT files will work only for the Object ... you can definitely do it from the driver. ... user mode DLLs and in the most cases can use any API ... functions like an ordinary app. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: OGL portability and future delivery
    ... it could be a severe impact against OpenGL. ... DirectX is no standardized API. ... DirectX 10 relies on the Windows Driver Model. ...
    (comp.graphics.api.opengl)
  • Re: checking and Copying a file when system is Loading
    ... Copying file to windos directory is ok,in this case i will use bib file, ... you can definitely do it from the driver. ... user mode DLLs and in the most cases can use any API ...
    (microsoft.public.windowsce.platbuilder)