29.04.2015 Views

DevKit8500D/A User Manual - DMCS Pages for Students

DevKit8500D/A User Manual - DMCS Pages for Students

DevKit8500D/A User Manual - DMCS Pages for Students

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Embedded CE 6.0 standard application program interface definition, <strong>DevKit8500D</strong>/A only expands<br />

interface definition of GPIO based on standard API. Please refer to the CD\wince_6\app <strong>for</strong> the<br />

application program representatives that control the status of LED through GPIO pin.<br />

Please check relative Help documents of MSDN Windows Embedded CE 6.0 API <strong>for</strong> Windows<br />

Embedded CE 6.0 standard application program interface definition.<br />

There are some use routines of standard API in the chapter GPIO<br />

Application Program Development Case <strong>for</strong> reference of users. Some<br />

interfaces exported by drivers can only be used by drivers; the application<br />

programs have no permission to call them.<br />

4.7.2 GPIO application program interfaces and examples<br />

GPIO device name is L"GIO1:", corresponding device IOCTL code includes:<br />

IOCTL Code<br />

Description<br />

IOCTL_GPIO_SETBIT Set GPIO pin as 1<br />

IOCTL_GPIO_CLRBIT Set GPIO pin as 0<br />

IOCTL_GPIO_GETBIT<br />

IOCTL_GPIO_SETMODE<br />

IOCTL_GPIO_GETMODE<br />

IOCTL_GPIO_GETIRQ<br />

Operation example is showed below:<br />

1) Open GPIO device<br />

pin<br />

Read GPIO pin<br />

Set the working mode of GPIO pin<br />

Read the working mode of GPIO pin<br />

Read the corresponding IRQ of GPIO<br />

HANDLE hFile = CreateFile(_T("GIO1:”), (GENERIC_READ|GENERIC_WRITE),<br />

(FILE_SHARE_READ|FILE_SHARE_WRITE), 0, OPEN_EXISTING, 0, 0);<br />

2) Set read the working mode of GPIO<br />

DWORD id = 0, mode = 0;<br />

3) Set the working mode of GPIO:<br />

DWORD pInBuffer[2];<br />

pInBuffer[0] = id;<br />

pInBuffer[1] = mode;<br />

92

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!