Commit e2237106 authored by Claes Sjofors's avatar Claes Sjofors

pwre configure script added

parent 3a2b3c5c
/*************************************************************
* *
* COPYRIGHT © 2007 Motion Control i Västerås AB, Sweden *
* *
* All rights including ownership and copyright to the *
* software herein are held by Motion Control i Västerås AB. *
* The software may be used and/ or copied only with the *
* written permission from Motion Control i Västerås AB or *
* in accordance with the terms and conditions stipulated *
* agreement/ contract under which the software has been *
* supplied. *
*------------------------------------------------------------*
* Programenhet : USBIO driver for Linux 2.6 *
* Filnamn : libusbio.h *
* Tillhörande libusbio.c *
* filer : *
*----------------------------------------------------------- *
* Beskrivning : Detta är H-filen för supportbiblioteket *
* till USB I/O enheten. *
*------------------------------------------------------------*
* Programhistoria : *
* Ver, Datum, Utförd av, *
* 1.0 07-01-29 Marcus Tönnäng *
* 1.2 07-02-06 Johan Zetterlund portad till Linux. *
* *
**************************************************************/
//Communication
int USBIO_Open(int *Handle);
// int USBIO_OpenBySerialNr(int *Handle, int Serial[]);
// int USBIO_OpenByIdNr(int *Handle, int IdNr);
int USBIO_Close(int *Handle);
int USBIO_IsConnected(int *Handle);
// int USBIO_SetTimeOut(int *Handle, unsigned int TimeOut);
// int USBIO_ListAll(int *Antal, int IdNr[]); //Ändra, mer info
//Read
int USBIO_ReadDI( int *Handle, int Port, int *Value);
int USBIO_ReadChannelDI( int *Handle, int Port, int Channel, int *Value);
int USBIO_ReadAI( int *Handle, int Channel, float *Value);
int USBIO_ReadAllAI( int *Handle, float AIValue[]);
int USBIO_ReadADVal( int *Handle, int Channel, int *Value);
int USBIO_ReadAllADVal( int *Handle, int ADValue[]);
int USBIO_ReadCounter( int *Handle, unsigned int *Value, int *Overflow);
int USBIO_ReadUART( int *Handle, int *Nr, unsigned char Value[], int *Overflow);
// int USBIO_ReadFreq( int *Handle, float *Value, float *Width);
//Write
int USBIO_WriteDO(int *Handle, int Port, int Value);
int USBIO_WriteChannelDO(int *Handle, int Port, int Channel, int Value);
int USBIO_WriteAO( int *Handle, int Channel, float Value);
int USBIO_WritePWM( int *Handle, int Channel, int Value);
int USBIO_WriteLowFreq( int *Handle, int Freq, unsigned char PortA, unsigned char PortB, unsigned char PortC);
int USBIO_WriteUART( int *Handle, unsigned char Value);
int USBIO_WriteLED( int *Handle, int Value);
//Configure
int USBIO_ConfigDIO(int *Handle, int Port, int Value);
int USBIO_ConfigAI(int *Handle, int Value);
int USBIO_ConfigAO(int *Handle, int Value);
int USBIO_ConfigPWM(int *Handle, int Value, int Freq);
int USBIO_ConfigCounter(int *Handle, int Value);
int USBIO_ConfigUART(int *Handle, int BaudRate);
//int USBIO_Reset(int *Handle);
int USBIO_SoftReset(int *Handle);
int USBIO_SetIdNr(int *Handle, int IdNr, char Description[]);
int USBIO_ConfigWatchdog(int *Handle, int Active, int TimeOut, int Reset, unsigned char PortMask[], unsigned char Port[], int AOfunction);
int USBIO_ResetWatchdog(int *Handle);
//Status
int USBIO_GetStatus(int *Handle, int Value[]);
int USBIO_GetFirmwareVersion(int *Handle, char *Version);
int USBIO_GetHardwareVersion(int *Handle, char *Version);
int USBIO_GetSerialNr(int *Handle, unsigned int *Serial);
int USBIO_GetLibVersion(char *Version);
int USBIO_GetIdNr(int *Handle, int *IdNr, char *Description);
//Error
int USBIO_GetErrorString(int Error, char *ErrorMessage , int *StringLength);
//Advanced functions
int USBIO_WriteAndRead(int *Handle, unsigned char WriteBuffer[], unsigned char ReadBuffer[]);
include $(pwre_dir_symbols)
ifndef variables_mk
-include $(pwre_croot)/src/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_croot)/src/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_croot)/src/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_croot)/src/tools/bld/src/$(os_name)/rules.mk
endif
.PHONY : all init copy lib exe clean realclean\
$(clean_c)
all : init copy lib
init :
copy : $(inc_dir)/libusbio.h
lib :
exe :
clean :
realclean : clean $(clean_obj)
.SUFFIXES:
#$(lib_dir)/libusbio.a : ../libusbio.a
# @ echo "Copying libusbio.a"
# @ $(cp) $(cpflags) $(source) $(target)
$(inc_dir)/libusbio.h : ../libusbio.h
@ echo "Copying libusbio.h"
@ $(cp) $(cpflags) $(source) $(target)
......@@ -2,7 +2,7 @@ ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \
$(objects) $(pwre_conf_libpwrrt) $(pwre_conf_lib) $(pwre_conf_libgtk);\
$(objects) $(pwre_conf_libpwrco) $(pwre_conf_lib) $(pwre_conf_libgtk);\
cp $(export_exe) $(eexe_dir)/
endif
......@@ -4,6 +4,6 @@ link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) $(pwr_obj)/dtt_rttsys.o\
$(pwr_obj)/rt_io_user.o $(pwr_lib)/libpwr_dtt.a -L$(pwr_elib)\
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
-lpwr_dtt $(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
......@@ -136,7 +136,7 @@ realclean : clean $(clean_h_includes) $(clean_hpp_includes) clean_dirs
$(export_exe) : $(link_rule) $(export_obj) $(objects)
@ $(log_link_exe)
$(link)
@ $(link)
# This is for Lynx 2.5 map files, it doesn't work for Linux. ML
......
......@@ -136,7 +136,7 @@ realclean : clean $(clean_h_includes) $(clean_hpp_includes) clean_dirs
$(export_exe) : $(link_rule) $(export_obj) $(objects)
@ $(log_link_exe)
$(link)
@ $(link)
# This is for Lynx 2.5 map files, it doesn't work for Linux. ML
......
......@@ -1256,17 +1256,24 @@ sub _build () # args: branch, subbranch, flavour, phase
my(@dirs2);
my($dir2);
my(@mfiles);
my($globstr1);
my($globstr2);
my($globstr3);
foreach $dir1 (@dirs1) {
$globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
if ( ! -e $globstr ) {
$globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
if ( ! -e $globstr ) {
$globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
}
}
@dirs2 = glob($globstr);
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
# }
# }
$globstr1 = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
$globstr2 = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
$globstr3 = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
@dirs2 = (glob($globstr1),glob($globstr2),glob($globstr3));
foreach $dir2 (@dirs2) {
if (-d $dir2) {
......
......@@ -272,7 +272,8 @@ while [ $i -lt $lib_cnt ]; do
done
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_dtt -lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy -lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\"-lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
......
......@@ -1256,17 +1256,24 @@ sub _build () # args: branch, subbranch, flavour, phase
my(@dirs2);
my($dir2);
my(@mfiles);
my($globstr1);
my($globstr2);
my($globstr3);
foreach $dir1 (@dirs1) {
$globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
if ( ! -e $globstr ) {
$globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
if ( ! -e $globstr ) {
$globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
}
}
@dirs2 = glob($globstr);
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
# }
# }
$globstr1 = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
$globstr2 = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
$globstr3 = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
@dirs2 = (glob($globstr1),glob($globstr2),glob($globstr3));
foreach $dir2 (@dirs2) {
if (-d $dir2) {
......
......@@ -272,7 +272,8 @@ while [ $i -lt $lib_cnt ]; do
done
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_dtt -lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy -lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\"-lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
......
......@@ -3,5 +3,5 @@ link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) \
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
$(pwre_conf_libpwrco) $(pwre_conf_lib)
endif
......@@ -6,7 +6,7 @@ link = $(ldxx) -L$(pwr_elib) $(elinkflags) $(domap) -o $(pwr_exe)/wb_ge_gtk \
$(pwr_eobj)/rt_io_user.o $(pwr_eobj)/wb_provider.o \
$(pwre_conf_libpwrwbgtk) $(pwre_conf_libpwrxttgtk) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbgtk) $(pwre_conf_libpwrwb) \
$(pwre_conf_libgtk) \
$(pwre_conf_libpwrxttgtk) $(pwre_conf_libpwrxtt) $(pwre_conf_libgtk) \
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment