Tews Technologies TPMC500-SW-42 Скачать руководство пользователя страница 5

 

 

TPMC500-SW-42 - VxWorks Device Driver  

Page 5 of 19 

2 Installation 

Following files are located on the distribution media: 

tp500drv.c 

TPMC500 Device Driver Source 

tp500def.h 

TPMC500 Local Include File 

tpmc500.h 

TPMC500 Application Include File 

tp500pci.c 

TPMC500 PCI MMU mapping for Intel x86 based targets 

tpxxxhwdep.c Collection 

of 

hardware dependent functions 

tpxxxhwdep.h 

Include for hardware dependent functions 

tp500exa.c Example 

Application 

 

For installation the files have to be copied to the desired target directory. 

2.1  Hardware dependent Configuration 

The driver is written to be used on TEWS carrier boards and others, but sometimes it is necessary to 
adapt the software. The following points have to be guaranteed: 

!

  full access to the PMC I/O area of the card 

!

  full access to PMC memory area of the card (correction data address space) 

!

  interrupt must be connected 

 

Most systems should work without any changes, but it may be necessary to setup address offsets or 
an offset between interrupt level and vector. Information for these values should be available in you 
BSP manual and/or CPU board manual. If such an adaptation is necessary you will get a warning 
while compilation. 

The values that have to be modified can be found in 

tpxxxhwdep.h

. There are three values that will be 

explicitly undefined after installation. To use these values, you have to define them with an appropriate 
value. 

USERDEFINED_MEM_OFFSET 

This value defines the offset between CPU-bus and 
PCI-bus address for memory accesses. 

USERDEFINED_IO_OFFSET 

This value defines the offset between CPU-bus and 
PCI-bus address for 16-bit I/0 accesses. 

USERDEFINED_LEV2VEC 

This value defines the value that should be added 
to the interrupt level number to get the interrupt 
vector number. 

 

If everything works fine while the values are undefined, and warnings are generated, you can define 
these values with a value of 0; 

2.2  Including the driver in VxWorks 

How to include the device drive in the VxWorks system is described in the VxWorks and Tornado 
manuals. 

Содержание TPMC500-SW-42

Страница 1: ...2 0 x User Manual Issue 2 0 0 October 2004 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek Germany e mail info tews com www tews com TEWS TECHNOLOGIES LLC 1 E Liberty Street Sixth Floor Reno Neva...

Страница 2: ...However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the ap...

Страница 3: ...rks 5 2 3 Special installation for Intel x86 based targets 6 3 I O SYSTEM FUNCTIONS 7 3 1 tp500Drv 7 3 2 tp500DevCreate 8 4 I O INTERFACE FUNCTIONS 10 4 1 open 10 4 2 close 12 4 3 read 13 4 4 ioctl 15...

Страница 4: ...eration of the TPMC500 32 Channel 12 bit ADC PMC conforming to the VxWorks I O system specification This includes a device independent basic I O interface with open read and ioctl functions The TPMC50...

Страница 5: ...anges but it may be necessary to setup address offsets or an offset between interrupt level and vector Information for these values should be available in you BSP manual and or CPU board manual If suc...

Страница 6: ...MU initialization is done by the BSP the function tp500PciInit won t be included and the user can skip to the following steps The C source file tp461pci c contains the function tp461PciInit This routi...

Страница 7: ...00Drv installs the TPMC500 driver in the I O system and initializes the driver SYNOPSIS STATUS tp500Drv void DESCRIPTION This function installs the TPMC500 driver in the I O system allocates driver re...

Страница 8: ...0 driver This function must be called before performing any I O request to this driver PARAMETER The name of the device is selected by the string which is deployed by this routine in the parameter nam...

Страница 9: ...mc500 h Create the device tpmc500 for the first found TPMC500 The mounted module is a TPMC500 10 status tp500DevCreate tpmc500 1 TPMC500_10 RETURNS OK or ERROR if the driver is not installed or the de...

Страница 10: ...to open int flags not used for TPMC500 driver must be 0 int mode not used for TPMC500 driver must be 0 DESCRIPTION Before I O can be performed to the TPMC500 device a file descriptor must be opened b...

Страница 11: ...VxWorks Device Driver Page 11 of 19 RETURNS A device descriptor number or ERROR if the device does not exist or no device descriptors are available INCLUDES ioLib h semLib h SEE ALSO ioLib basic I O...

Страница 12: ...lose int fd descriptor to close DESCRIPTION This function closes opened devices EXAMPLE int retval Close the device retval close fd RETURNS A device descriptor number or ERROR if the device does not e...

Страница 13: ...ints to the special I O structure TP500_IO_BUFFER refer to tpmc500 h The argument maxbytes is not used for the device driver data structure TP500_IO_BUFFER typedef struct int Channel Channel number in...

Страница 14: ...e actual value of the input differential channel 1 the gain shall be 2 and the value shall be corrected buf Channel 1 buf Gain 2 buf flags TP500_CORRENA TP500_DIFFMODE result read fd buf 0 RETURNS ERR...

Страница 15: ...ing the ioctl function with a specific function code and an optional function dependent argument PARAMETER The parameter fd specifies the device descriptor of the opened TPMC500 device The parameter f...

Страница 16: ...s specifying the channel setups The used data structure is the same used by the read command for more information refer to the read command The argument buf_size specifies the size of the input FIFO T...

Страница 17: ...e ended data correction off gain 5 seq_buf cycletime 10000 Cycletime 1s seq_buf buffer seq_data_buf seq_buf act_channels 2 seq_buf buf_size SBUF_SIZE seq_buf act_channels seq_buf chan_setup seq_rw_par...

Страница 18: ...TPMC500 SW 42 VxWorks Device Driver Page 18 of 19 Stop Sequencer result ioctl fd FIOSTOPSEQ 0 if result OK Sequencer started else Error when starting the sequencer...

Страница 19: ...device driver creates an error the error codes are stored in the errno They can be read with the VxWorks function errnoGet or printErrno S_tp500Drv_ICHAN 0x05000001 Illegal channel number specified S_...

Отзывы: