AXIOMTEK IRU151-I User manual

IRU151-I
Software Development
Kit
Reference Manual

ii
Revision History
Version
Revised
Date
Author
Description
1.0
2018/12/05
Hank
- 1st release

iii
How to Use This Document
This document is written to provide the information of the SDK and helps users
implement their own applications
Chapter 1, “Basic Structure” introduces the fundamental information for applying
the functions in this document.
Chapter 2, “Function Description” introduces the detailed information of the
functions provided by the SDK.
Appendix A, “Error Code”describes the meaning of the error code returned by
the functions.
Appendix B, “Function Table”shows all IRU151 function.

iv
Table of Contents
Revision History............................................................................................ii
How to Use This Document ........................................................................iii
CHAPTER 1 Introduction ................................................................... 1
1.1 The Basic of the Programming.................................................1
1.2 Create a Receiver Data Example ..............................................3
1.3 The Calibration Flow Chart .......................................................5
CHAPTER 2 Function Description................................................... 7
2.1 Open_Device ..............................................................................7
2.2 CloseDevice................................................................................8
2.3 GetDevInfoEx..............................................................................9
2.4 EnAIReceiver............................................................................10
2.5 DisAIReceiver...........................................................................11
2.6 ReadAIDataEx...........................................................................12
2.7 ReadAIVoltEx............................................................................13
2.8 SetAITrigConfEx.......................................................................15
2.9 SetAIChannel............................................................................16
2.10 SetAISampleRate .....................................................................17
2.11 SetAInputRange .......................................................................18
2.12 FactoryCalibratedRestore .......................................................19
2.13 ReadCaliFactors.......................................................................20
2.14 GetAISingleValueEx.................................................................21
2.15 GetAIinitConfEx........................................................................23
2.16 SetAIinitConf ............................................................................24
2.17 AICalibrationEx ........................................................................25
2.18 RestoreAIConf..........................................................................27
2.19 GetAIDataLength......................................................................28
2.20 GetDITrigConfEx ......................................................................29
2.21 ClearDITrigConf........................................................................30
2.22 SetDITrigConf...........................................................................31
2.23 GetDILevelEx............................................................................32
2.24 EnDIReceiver............................................................................33
2.25 DisDIReceiver...........................................................................34
2.26 EnDICounterEx.........................................................................35
2.27 DisDICounterEx........................................................................36
2.28 GetDICounterEx .......................................................................37
2.29 SetDICounterCompletedCallback...........................................38
2.30 SetDIStatusChangedCallback.................................................39
2.31 GetDOInitConfEx......................................................................40

v
2.32 ClearDOInitConf .......................................................................41
2.33 SetDOInitConf...........................................................................42
2.34 SetDOStatus.............................................................................43
2.35 GetDOStatus.............................................................................44
2.36 EnDOPWM ................................................................................45
2.37 DisDOPWM ...............................................................................46
2.38 GetDOPWMConf.......................................................................47
APPENDIX A Error Code.................................................................. 49

vi
This page is intentionally left blank.

IRU151-I Programmer Guidel
Introduction 1
CHAPTER 1
Introduction
This chapter introduces the information of the SDK.
1.1 The Basic of the Programming
To create an application with SDK, please follow the steps below.
Step 1 : Include IRU head file.
When user program a IRU application to call IRU API, user has to include "libiru.h"
and "axiomtek_err.h" files.
"libiru.h" files is for API and control IRU device.
and "axiomtek_err.h" files. Is error code respectively.
It can help user to analyze what problem is.
#include "libiru.h"
#include "axiomtek_err.h"
Step 2 : Create a device
int ret;
ret = Open_Device("IRU151");
if(ret != AXIO_OK)
printf("Create Device Failure\n");
(Continue)

IRU151-I Programmer Guidel
2 Introduction
Step 3 : Get information from device via API
int i=0;
char *pDevInfo;
short length;
(Continue)
int modelidx = 1;
ret = GetDevInfo(modelidx, &pDevInfo, &length);
if(ret == AXIO_OK){
for(i=0;i<length;i++)
printf("%c", toascii( *(pDevInfo +i)));
printf("\n");
} else
printf("Get Device info failure\n");
Step 4 : Close a device.
Close_Device();
Step 5 : The application can be closed

IRU151-I Programmer Guidel
Introduction 3
1.2 Create a Receiver Data Example
This example shows how to receive DI data. The sample is for a digital I/O receiver.
#define AXIO_OK 0x00
int channel = 1;
int filter = 0
int trig = 2;
int stop;
int ret;
ret = Open_Device("IRU151");
if(ret != AXIO_OK){
printf("open iru151 failure …\n");
return;
}
while(1)
{
switch(stop){
case 0:
ret = EnDIReceiver(channel, filter, trig);
if(ret != AXIO_OK)
printf("Enable DI Receiver failure \n");
break;
case 1:
ret = DisDIReceiver(channel);
if(ret != AXIO_OK)
printf("Enable DI Receiver failure \n");
break;
case 2:
printf("Exit \n");
break;
}

IRU151-I Programmer Guidel
4 Introduction
if(stop == 2){
break;
}
}
Close_Device();
Table of contents
Other AXIOMTEK Microcontroller manuals
Popular Microcontroller manuals by other brands

AMS
AMS AS7261 Demo Kit user guide

Novatek
Novatek NT6861 manual

Espressif Systems
Espressif Systems ESP8266 SDK AT Instruction Set

Nuvoton
Nuvoton ISD61S00 ChipCorder Design guide

STMicrolectronics
STMicrolectronics ST7 Assembler Linker user manual

Texas Instruments
Texas Instruments Chipcon CC2420DK user manual

Texas Instruments
Texas Instruments TMS320F2837 D Series Workshop Guide and Lab Manual

CYPRES
CYPRES CY14NVSRAMKIT-001 user guide

Texas Instruments
Texas Instruments INA-DUAL-2AMP-EVM user guide

Espressif Systems
Espressif Systems ESP8266EX Programming guide

Abov
Abov AC33M8128L user manual

Laird
Laird BL654PA user guide







