GPIO Develop Utility under Windows

From LEXWiKi

(Difference between revisions)
Jump to: navigation, search
(How to use DLL)
Line 51: Line 51:
'''*Step2.''' Initialize GPIO module resource.<br />
'''*Step2.''' Initialize GPIO module resource.<br />
-
'''MODULE_GPIO_LIST_E''' defined in '''GPIOUtilityDll.h'''
+
'''MODULE_GPIO_LIST_E''' defined in '''GPIOUtilityDll.h'''<br />
 +
 
 +
enum MODULE_GPIO_LIST_E
 +
{
 +
/* GPIO */
 +
MODULE_GPIO_F75111 = 0,
 +
MODULE_GPIO_F75111_EXT,
 +
MODULE_GPIO_F75113,
 +
MODULE_GPIO_F75113_LPC,
 +
MODULE_GPIO_F81966_LPC,
 +
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
Line 65: Line 75:
-
'''*Step3.''' Get informations from PW601 develop DLL.<br />
+
'''*Step3.''' If you want control GPIO pin, setup DI pin and DO pin in CIO port. */.<br />
 +
 
 +
'''GPIO_CIO_PORT_E''' defined in '''GPIOUtilityDll.h'''<br />
 +
Setup DI pin and DO pin. Use 1 byte to indicate the status of the Pins.<br />
 +
(DI-0 is bit0, DI-1 is bit1, DI-2 is bit2 and DI-3 is bit3).<br />
 +
 
 +
enum GPIO_CIO_PORT_E
 +
{
 +
GPIO_CIO_1 = 1,
 +
GPIO_CIO_2,
 +
GPIO_CIO_3,
 +
GPIO_CIO_4,
 +
};
 +
 
 +
//--------------------------------------------------------------------------
 +
// Name : GPIODLL_AddControlModuleToWatchList
 +
// Description : Add GPIO device module to watch dog list.
 +
// Arguments :
 +
// nModule [in] : GPIO device module. Enum of MODULE_GPIO_LIST_E.
 +
// nSwPort [in] : SW Port
 +
// bDIOBits [in] : DI/DO bits. (Output bit is 1; Input bit is 0)
 +
// nFilterDO [in] : Filter DO signal from GPIO module (default: TRUE)
 +
// Return :
 +
// TRUE : Success
 +
// FALSE : Failed
 +
//--------------------------------------------------------------------------
 +
GPIOUTILITYDLL_API int GPIODLL_AddControlModuleToWatchList(int nModule, int nSwPort, BYTE bDIOBits, int nFilterDO = TRUE);
 +
 
 +
 
 +
'''*Step4.''' If you want control GPIO pin, setup DI pin and DO pin in CIO port. */.<br />
 +
 
-
[[Image:Use_DLL_2.png]] <br/>
 
'''*Final Step.''' Release PW601 resource before leaving application.
'''*Final Step.''' Release PW601 resource before leaving application.
[[Image:Release_DLL.png]] <br/>
[[Image:Release_DLL.png]] <br/>

Revision as of 15:49, 23 September 2024


Contents

Introduction

GPIO Develop Utility can help you to develop tool to control GPIO device.


The binary file you can download from

<Google Drive>

DLL file(64 bit): PW601Dll_v1.0.10.7_x64

Sample file(64 bit): PW601Dll_v1.0.10.7_x64

Sample code: UsePW601Dll(v1.0.10.7)_SampleCode


DLL files descreption

GPIOUtilityDll.dll: Contains code and data about GPIODLL function.

GPIOUtilityDll.h: Header about GPIODLL function.

GPIOUtilityDll.lib: Import library that link to GPIOUtilityDll.dll.

LexIo64.dll、LexIo64.sys: Based on WinIO that provids DLL to read hardware data. For x64.


Support GPIO module

F75111(Onboard)、F75111 EXT(CIO series)、F75113 SMBUS、F75113 LPC、F81966 LPC.


How to use DLL

*Step1. Unzip DLL zip file and put files to your programe.


*Step2. Initialize GPIO module resource.

MODULE_GPIO_LIST_E defined in GPIOUtilityDll.h

 enum MODULE_GPIO_LIST_E
 {
     /* GPIO */
     MODULE_GPIO_F75111 = 0,
     MODULE_GPIO_F75111_EXT,
     MODULE_GPIO_F75113,
     MODULE_GPIO_F75113_LPC,
     MODULE_GPIO_F81966_LPC,
 };
 //------------------------------------------------------------------------------
 // Name        : GPIODLL_InstallControlModule
 // Description : Initial DLL supported GPIO device module.
 // Arguments   : 
 //   nModule [in] : GPIO device module. Enum of MODULE_GPIO_LIST_E.
 // Return      : 
 //   TRUE  : Success
 //   FALSE : Failed
 //------------------------------------------------------------------------------ 
 GPIOUTILITYDLL_API int GPIODLL_InstallControlModule(int nModule);


*Step3. If you want control GPIO pin, setup DI pin and DO pin in CIO port. */.

GPIO_CIO_PORT_E defined in GPIOUtilityDll.h
Setup DI pin and DO pin. Use 1 byte to indicate the status of the Pins.
(DI-0 is bit0, DI-1 is bit1, DI-2 is bit2 and DI-3 is bit3).

 enum GPIO_CIO_PORT_E
 {
     GPIO_CIO_1 = 1,
     GPIO_CIO_2,
     GPIO_CIO_3,
     GPIO_CIO_4,
 };
 //--------------------------------------------------------------------------
 // Name        : GPIODLL_AddControlModuleToWatchList
 // Description : Add GPIO device module to watch dog list.
 // Arguments   : 
 //   nModule   [in] : GPIO device module. Enum of MODULE_GPIO_LIST_E.
 //   nSwPort   [in] : SW Port
 //   bDIOBits  [in] : DI/DO bits. (Output bit is 1; Input bit is 0)
 //   nFilterDO [in] : Filter DO signal from GPIO module (default: TRUE)
 // Return      : 
 //   TRUE  : Success
 //   FALSE : Failed
 //--------------------------------------------------------------------------
 GPIOUTILITYDLL_API int GPIODLL_AddControlModuleToWatchList(int nModule, int nSwPort, BYTE bDIOBits, int nFilterDO = TRUE);


*Step4. If you want control GPIO pin, setup DI pin and DO pin in CIO port. */.


*Final Step. Release PW601 resource before leaving application.

Image:Release_DLL.png

Personal tools