UPS25 API Manual for Windows 2000/XP/Vista Version 3.0 SWM-640020008 Rev.
RTD Embedded Technologies, INC. 103 Innovation Blvd. State College, PA 16803-0906 Phone: +1-814-234-8087 FAX: +1-814-234-5218 E-mail sales@rtd.com techsupport@rtd.com web site http://www.rtd.
Revision History 09/23/2004 Revision A issued Documented for ISO9000 10/20/2008 Revision B issued Updated to match version 3.0 of the Windows software Improved layout and section naming UPS25 API Manual for Windows 2000/XP/Vista Published by: RTD Embedded Technologies, Inc. 103 Innovation Blvd. State College, PA 16803-0906 Copyright 2004 by RTD Embedded Technologies, Inc. All rights reserved Printed in U.S.A. The RTD Logo is a registered trademark of RTD Embedded Technologies.
Table of Contents WINDOWS INSTALLATION .....................................................................................................5 INSTALLING THE WINDOWS SOFTWARE ........................................................................................5 USING THE DRIVER ..................................................................................................................6 GETTING A HANDLE TO THE BOARD .....................................................................................
Windows Installation Installing the Windows Software Before installing the Windows software, you need to install the UPS25 board in your system. Please follow the instructions in the hardware manual to install the board. In the software package, you can find the Setup.exe program, which installs the UPS25 device driver and monitoring application. After starting the setup program, please follow the instructions on the screen to install the Windows software.
Using The Driver The UPS25 can be controlled from software via the driver’s IOCTL interface. Using an IOCTL interface is the standard way of communicating with a Windows driver. This interface is accessed using the’ DeviceIOControl’ function. In the application source code you can find different examples of how to use the driver. Some special examples are given below.
IOCTL Reference 7 UPS25 API Manual for Windows 2000/XP/Vista
Board Control IOCTLs UPS25_SET_CONTROL Description: This IOCTL sets the current configuration of the board. Parameters: Input: An eight bit value: BIT 0: 0 – Interrupts Disabled 1 – Interrupts Enabled BIT 2: 0 – Batteries disconnected from board to prevent discharge 1 – Batteries connected to board for backup purposes BIT 3: 0 – Charger active. Charging can take place 1 – Charger inactive. No charging possible.
DeviceIoControl( hDevice, UPS25_SET_DISCONNECTBATT, NULL, 0, NULL, 0, &BytesReturned, NULL); UPS25_SET_MODE Description: This IOCTL initializes an event object that will be set when an interrupt occurs on the board. Parameters: Input: An ENABLEINTERRUPTS structure. Output: None Example: ENABLEINTERRUPTS Msg; OVERLAPPED o; ULONG i; o.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); Msg.IntEvent = o.
DeviceIoControl( hDevice, UPS25_SET_NODISCONNECTBATT, NULL, 0, NULL, 0, &BytesReturned, NULL); UPS25_SET_POWER_DOWN_CONTROL Description: This IOCTL alters the state of the backlight switch. Parameters: Input: An 8 Bit value: BIT 0: 0 – Backlight is disabled. 1 – Backlight is enabled.
Board Information IOCTLs UPS25_GET_CONTROL Description: This IOCTL returns the current configuration of the board. Parameters: Input: None Output: An eight bit value: BIT 0: 0 – Interrupts Disabled 1 – Interrupts Enabled BIT 2: 0 – Batteries disconnected from board to prevent discharge 1 – Batteries connected to board for backup purposes BIT 3: 0 – Charger active. Charging can take place 1 – Charger inactive. No charging possible.
UCHAR Info; ULONG BytesReturned; DeviceIOControl( hDevice, UPS25_GET_INFO, NULL, 0, &Info, sizeof(Info), &BytesReturned, NULL); UPS25_GET_STATUS Description: This IOCTL gathers the current status of the board. Parameters: Input: None Output: An 8 bit value: BIT 0: 0 – Main Supply voltage low. System is in backup state 1 – Main power OK. BIT 1: 0 – Battery Voltage Low. 1 – Battery Voltage OK. BIT 2: Charger Status LED. See Table 4-1 ‘Charger status LED functional description’ in the hardware manual.
Parameters: Input: None Output: An 8 bit value: BIT 0: 0 – Backlight is disabled. 1 – Backlight is enabled.
Limited Warranty RTD Embedded Technologies, Inc. warrants the hardware and software products it manufactures and produces to be free from defects in materials and workmanship for one year following the date of shipment from RTD Embedded Technologies, INC. This warranty is limited to the original purchaser of product and is not transferable.
RTD Embedded Technologies, Inc. 103 Innovation Blvd. State College PA 16803-0906 USA Our website: www.rtd.