Table of Contents

x86 EAPI Windows

WORK IN PROGRESS

Preface

EAPI is intended to be installed on Windows 7 64-bit and Windows 10 64-bit.

On Windows 7 KB3033929 update must be installed on the system to support SHA-2 Code Signing Certificate.
More information about it is available at:
https://technet.microsoft.com/en-us/library/security/3033929.aspx

Installation

EAPI installation

  1. Download the EAPI archive and decompress it onto an USB drive.
  2. Plugin the USB drive to the Starterkit
  3. Run the Windows command prompt as administrator and navigate into the TqWin64EAPI_R01.01 folder on the USB drive
  4. Execute install.batch from the command prompt


EAPI uninstallation

  1. Open Windows Device Manager
  2. Find System Devices→Tq driver.
  3. Select Uninstall and check “Delete the driver software for this device”


EAPI verifying installation

  1. Right click on TqDrv.sys file from this package and choose Properties→Details to locate file version.
  2. Make sure that TqDrv.sys file version and driver version in Device Manager are identical.
  3. Make sure that TqDrv.sys file from C:\Windows\System32\drivers is identical to one from this package.

EAPI Functions

For detailed functions description please refer to PICMG EAPI specification: COM_EAPI_R1_0.pdf
All examples are using the sample application TqApp.exe.
The TqApp is available in sources and is provided as a part of the EAPI package.

EAPI Initialisation

The EApiLibInitialize function has to be called at the beginning of every application.
An error will be returned if TQ driver is not installed on the system.

The EApiLibUnInitialize function has to be called at the end of every application.


EAPI Information Functions

EApiBoardGetStringA

Supported EAPI ID values:

Example


EApiBoardGetValue

Supported EAPI ID values:

Supported Values for EApiBoardGetValue function

Example


  • Temperature sensors values are in 0.1 Kelvin.
  • Voltage sensors values are in millivolts.
  • Fan speed values are in RPM.

EAPI Display Backlight

Backlight Functions are only available if a suitable display is connected.
Latest Intel(R) HD Graphics driver has be installed on the system.
Backlight can only be enabled/disabled via BIOS.

Supported Functions

EApiVgaGetBacklightEnable Returns current Backlight Enable state
EApiVgaGetBacklightBrightness Get Backlight Brightness Value (0-255)
EApiVgaSetBacklightBrightness Set Backlight Brightness Value (0-255)



EAPI Storage Functions

EEPROM

There are 2 available EEPROMs available on the TQ x86 Starterkits

EApiStorageCap

Function returns Storage Size and Block Length value, needed to calculate write block alignment and size for EApiStorageAreaWrite function.

EApiStorageAreaRead
EApiStorageAreaRead ID Offset Bytecnt
Datatype dec hex dec

Example:

EApiStorageAreaWrite

Offset and ByteCnt parameters must be a multiple of Block Length value that is returned by EApiStorageCap function.

EApiStorageAreaWrite ID Offset Data
Datatype dec hex hex …. hex

Example:


EAPI I2C Bus Functions

The current frequency is defined in Windows registry:

HKLM\SYSTEM\CurrentControlSet\Services\TqDrv\Parameters\I2cBusSpeed

100KHz are set as default frequency, the following frequencies are available for the primary CPLD I2C Bus:

After changing I2C frequency in Windows registry, Tq driver must be reset in Windows Device Manager:

- Open Windows Device Manager -> System Devices -> TqDriver
- Right Click on TqDriver and select "Disable" 
- Right click on TqDriver and select "Enable
EApiI2CWriteReadRawr
EApiI2CWriteReadRaw bus_id i2c_addr string_to_write bytes_to_read
Datatype dec hex hex … hex dec

To ignore write operation: <string_to_write> = “”
To ignore read operation: <bytes_to_read> = 0

Example:

EApiI2CReadTransfer | EApiI2CWriteTransfer
EApiI2CReadTransfer bus_id i2c_addr cmd type bytes_to_read
EApiI2CWriteTransfer bus_id i2c_addr cmd type bytes_to_write
Datatype dec hex hex hex dec

where 'type' = 0/1/2 (No Command/ Standard Command/ Extended Command)

Examples


EAPI Watchdog Functions

EApiWDogStart

Delay mode is not supported. Event mode and Reset mode are supported.

List of possible Watchdog timeout values

If timeout falls between these values, the closest top value will be used: For Example:
For 10 seconds - 16 secnds will be used.
For 683 seconds - 1024 seconds will be used.

Event Mode

Event timeout must be defined, other Timeout values must be 0.
2 interrupt lines are supported: 10 and 11.
Default line is 11.
Interrupt number must be defined in 2 places:

To change IRQ line you need to change it in 2 places. After that you need to reset Tq driver in Windows Device Manager:

Reset mode

Reset timeout must be defined, other Timeout values must be 0.
Following reset modes are supported:
1 = watchdog reset output triggers hard reset signal
0 = watchdog reset output triggers power-on button
Reset mode is definded in Windows Registry, default value is 1.

HKLM\SYSTEM\CurrentControlSet\Services\TqDrv\Parameters\WdtReset
Dual-Stage Mode

In dual-stage mode (Event + Reset) Event timeout will be used for both stages. Event timeout must be defined, reset timeout must not equal zero.
EApiWDogStart <Delay> <EventTimeout> <ResetTimeout>
Time must be specified in ms.
Example:

EApiWDogStart 0 15200 1000

GPIO

8 GPIO's are available all TQ x86 Modules , all of them can be defined as output or input.
The EAPI library defines two different mechanisms to address GPIO: pin addressing and bank addressing.
Function EAPI_GPIO_BANK_ID(GPIO_NUM) is used to define the GPIO bank.

EApiGPIOGetDirection

TqApp function EApiGPIOGetDirectionuses bank addressing.

Example:

EApiGPIOSetDirection

EApiGPIOSetDirection <Pin> <Direction> uses pin addressing.

GPIO Direction Value
Output 0
Input 1

Example:
Setting pin 2 to output

> TqApp.exe EApiGPIOSetDirection 2 0
EApiGPIOSetLevel

EApiGPIOSetLevel <bank> uses bank addressing, where <bank> is a group of 32 pins addressed simultaneously. Example:

> TqApp.exe EApiGPIOsetLevel 4 1
EApiGPIOGetLevel

EApiGPIOGetLevel <bank> uses bank addressing, where <bank> is a group of 32 pins addressed simultaneously. Example:

> TqApp.exe EApiGPIOGetLevel 0
Bank 0: LEVEL = 0xfb

TQ Library Functions

TqWdtWaitForInterrupt

This function detects Watchdog interrupts, there is a standalone application for TqWdtWaitForInterrupt because it’s not part of EAPI.

Examples



Known Issues