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

 

 

TPMC500-SW-42 - VxWorks Device Driver  

Page 6 of 19 

2.3  Special installation for Intel x86 based targets 

The TPMC500 device driver is fully adapted for Intel x86 based targets. This is done by conditional 
compilation directives inside the source code and controlled by the VxWorks global defined macro 

CPU

. If the contents of this macro is equal to 

I80386

I80386

 or 

PENTIUM

 special Intel x86 

conforming code and function calls will be included. 

The second problem for Intel x86 based platforms can’t be solved by conditional compilation 
directives. Due to the fact that some Intel x86 BSP’s doesn’t map PCI memory spaces of devices 
which are not used by the BSP, the required PCI memory spaces can’t be accessed.   

To solve this problem a MMU mapping entry has to be added for the required TPMC500 PCI memory 
spaces prior the MMU initialization (

usrMmuInit()

) is done. 

Please examine the BSP documentation or contact the BSP Vendor whether the BSP perform 
automatic PCI and MMU configuration or not. If the PCI and MMU 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 routine finds out all TPMC461 

devices and adds MMU mapping entries for all used PCI memory spaces. Please insert a call to this 
function after the PCI initialization is done and prior to MMU initialization (

usrMmuInit()

). 

If the Tornado 2.0/2.2 project facility is used, the right place to call the function 

tp500PciInit()

 is at the 

end of the function 

sysHwInit()

 in 

sysLib.c

 (can be opened from the project 

Files

 window).  

Be sure that the function is called prior to MMU initialization otherwise the TPCM500 PCI spaces 
remains unmapped and an access fault occurs during driver initialization. 

Please insert the following call at a suitable place in either 

sysLib.c

 or 

usrConfig.c

tp500PciInit(); 

The function 

tp500PciInit()

 is designed for and tested on generic Pentium targets. If another 

BSP is used, please refer to BSP documentation or contact the technical support for required 
adaptation. 

If strange errors appeared after system startup with the new build system please carrying out a 
VxWorks 

build clean

 and 

build all

Содержание 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_...

Отзывы: