README Driver File Contents (AS59099V2_0.zip)

=========
README
=========

Installation Guide
------------------

This file contains the installation guide for AX5095P driver version 1.00 for Linux.

The AX5095P driver utility disk contains:

1. Readme : This file
2. ax5095p_1.0.0.tar : AX5095P device driver compressed file.

Make a new directory, for example "ax5095p", then copy ax5095p_1.0.0.tar into it.

To extract ax5095p_1.0.0.tar, do:
   tar -xf ax5095p_1.0.0.tar

After extracting, you will see the following files:

. ax5095p.o -- Kernel device driver.
. linklib.o -- Interface library.
. global.h -- Header file.
. AI_SOFTWARE_TRIGGER.c -- Analog input with software trigger demo program.
. AI_WITH_DMA.c -- Analog input with DMA demo program.
. AI_WITH_DMA_CAPTURE.c -- Analog input with DMA capture mode demo program.
. DA.c -- Analog output demo program.
. DIO.c -- Digital input and output demo program.

Do below steps to register and install kernel module before starting to access AX5095P :

1. In "ax5095p" directory, do:
   mknod /dev/ax5905p c 13 0

2. To insert module, do:
   insmod ax5095p.o

Use the following compile command to compile a demo program:
   gcc linklib.o DIO.c -o DIO.o
which will generate DIO.o file. Copy this DIO.o file to /bin directory then you can execute it.

The development environment of this device driver is as follows:
-	GNU Make version 3.78.1
-	GNU gcc version egcs-2.91.66
-	Linux kernel 2.2.16 tested


Function List
-------------

Function: card_start
This function initializes device driver. Use this function once at the very beginning before calling the other functions. Remember to terminate device driver with card_stop() function.

Syntax:
short int card_start();

Argument:
None

Return:
0		Success
-HARDWAREERROR	Initialization fails.


Function: card_stop
This function terminates device driver. Call this function, when you want to terminate your application or device driver.

Syntax:
void card_stop();

Argument:
None

Return:
None


Function: digital_input
Read data from digital input port.

Syntax:
char digital_input();

Argument:
None

Return:
Digital input data.


Function: digital_output
Write data to digital output port.

Syntax:
void digital_output(char data);

Argument:
data
Digital output data.

Return:
None


Function: analog_output
Write data to analog output port.

Syntax:
void analog_output(short int ch, short int ref, float data);

Argument:
ch
0	Analog output channel #0
1	Analog output channel #1

ref
Analog output reference index; -5 or -10. Refer to onboard jumper setting.

data
Analog output data.

Return:
None


Function: set_range_gain
Use this function to set range of analog input. Each of the 16 analog input channel can be set to different range setting. The range setting is as follows:
G1PB	-5 to +5V
G2PB	-2.5 to +2.5V 
G4PB	-1.25 to +1.25V
G8PB	-0.625 to +0.625V
GHPB	-10 to +10V
G1PU	0 to +10V
G2PU	0 to +5V
G4PU	0 to +2.5V
G8PU	0 to +1.25V

Syntax:
void set_range_gain(int *RgGn);

Argument:
RgGn
Pointer to a 16-member-array. Each member corresponds to one analog input channel. 

Return:
None


Function: sfttrg
Perform analog input with software trigger.

Syntax:
short int sfttrg(short int ch);

Argument:
ch
Analog input channel number.

Return:
Analog input data.


Function: raw_to_float
Perform data convertion from raw data to real data.

Syntax:
float raw_to_float(short int ch, unsigned short int raw);

Argument:
ch
Analog input channel number.

raw
Raw data for convertion.

Return:
Analog input data in voltage.


Function: init_DMA
This function initializes analog input with DMA operation. Remember to terminate operation with end_DMA() function.

Syntax:
short int init_DMA(short int startch, short int stopch, short int divisor1,short int divisor2, unsigned int DMA_buffer_wsize, unsigned int alarm_trigger_mode, float high_limit, float low_limit, unsigned int DMA_mode, int data_cnt, int pre_cnt);

Argument:
startch
Scan start channel number.

stopch
Scan stop channel number.

divisor1
Divider of counter #1

divisor2
Divider of counter #2

DMA_buffer_wsize
DMA buffer size (in word) used by device driver.

alarm_trigger_mode
DMA mode: NONE_ALARM_TRIGGER, AD_ALARM_UP, AD_ALARM_MIDDLE, AD_ALARM_DOWN, AD_ALARM_OUT, AD_TRIGGER_RISING, AD_TRIGGER_FALLING, AD_CAPTURE_DATA_UP, AD_CAPTURE_DATA_MIDDLE, AD_CAPTURE_DATA_DOWN, AD_CAPTURE_DATA_OUT. Detail information can be found in hardware user's manual.

high_limit
Alarm high limit.

low_limit
Alarm low limit.

DMA_mode
DMA_RETURN_MODE	Function returns immediately if data is not ready. User is recommended to set for this mode if it is possibly that data won't be ready for a long time.
DMA_WAIT_MODE	Function sleeps until data is ready.

data_cnt
Remember data_cnt must not larger than DMA_buffer_wsize. In AD_CAPTURE_DATA_UP, AD_CAPTURE_DATA_MIDDLE, AD_CAPTURE_DATA_DOWN or AD_CAPTURE_DATA_OUT mode, this parameter represents the amount of data captured for one channel. In NONE_ALARM_TRIGGER, AD_ALARM_UP, AD_ALARM_MIDDLE, AD_ALARM_DOWN, AD_ALARM_OUT, AD_TRIGGER_RISING, AD_TRIGGER_FALLING, this parameter represents total desired data. 

pre_cnt
Only for AD_CAPTURE_DATA_UP, AD_CAPTURE_DATA_MIDDLE, AD_CAPTURE_DATA_DOWN or AD_CAPTURE_DATA_OUT mode. This is the amount of data required by user before setting condition occurs.

Return:
0		Success
-PARAERROR	Parameter error.
-MEMALOCERR	Memory allocation error.


Function: copy_DMA_data
Use this function to copy DMA data.

Syntax:
long copy_DMA_data(short int *data);

Argument:
data
A pointer to data buffer. In AD_CAPTURE_DATA_UP, AD_CAPTURE_DATA_MIDDLE, AD_CAPTURE_DATA_DOWN or AD_CAPTURE_DATA_OUT mode, the size of this buffer should be >= data_cnt * number of channels. In NONE_ALARM_TRIGGER, AD_ALARM_UP, AD_ALARM_MIDDLE, AD_ALARM_DOWN, AD_ALARM_OUT, AD_TRIGGER_RISING, AD_TRIGGER_FALLING, the size of this buffer should be >= data_cnt.

Return:
>0	Actual amount of data copied.
<0	Data not ready.


Function: end_DMA
Terminates analog input with DMA operation initialized by init_DMA() function.

Syntax:
short int end_DMA();

Argument:
None




Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web5, load: 0.61