Home

User Manual - TEWS TECHNOLOGIES

image

Contents

1. Register vector OxCC for interrupt event vecBuf action GENERICIPAC_REGISTER vecBuf intVectorNo 0xCC CARRIER SW 65 Windows Device Driver Page 36 of 50 TEWS amp TECHNOLOGIES success DeviceloControl hDevice ITOCTL_GENERICIPAC_REGISTER_EVENT_VECTOR amp vecBuf sizeof GENERICIPAC_REGISTER_EVENT_VECTOR_PAR NULL 0 amp NumBytes NULL if success vector successful registered else ErrorHandler Device I O control error process error ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR_BUSY For action GENERICIPAC_REGISTER the vector has already been registered For action GENERICIPAC_UNREGISTER the vector has not been registered ERROR _INVALID PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 37 of 50 TEWS amp TECHNOLOGIES 3 1 3 10 IlOCTL_GENERICIPAC_WAIT_FOR_EVENT This function enables interrupts for the generic IPAC and waits for an interrupt event The function will wait until an event occurs or the specified timeout has passed The interrupt normally have to be cleared by the application e g by using the hardware access
2. unsigned int size void ptr GENERICIPAC_MAP_PAR size This value returns the size of the mapped space This value may be used to check the virtual space limits The offset is specified in byte ptr The pointer is the mapped virtual address which can be used for direct IPAC access EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes int spaceSelector GENERICIPAC_MAP_PAR mapBuf unsigned short usIpacPtr CARRIER SW 65 Windows Device Driver Page 41 of 50 TEWS amp TECHNOLOGIES Map memory space of generic IPAC spaceSelector GENERICIPAC_MEMSPACE success DeviceloControl hDevice TOCTL_GENERICIPAC_MAP_ SPACE amp spaceSelector sizeof spaceSelector amp mapBuf sizeof GENERICIPAC_MAP_PAR amp NumBytes NULL if success usIpacPtr unsigned short mapBuf ptr printf Space size d Byte n mapBuf size printf Mem Data direct 0x 04x 0x 04x n usIpacPtr 0 usIpacPtr 1 else ErrorHandler Device I O control error process error Unmap IPAC space ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR_NOT_ENOUGH_MEMORY The specified IPAC space cannot
3. ERROR_NOACCESS Access exceeds limits of space ERROR_INVALID_ PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 23 of 50 TEWS amp TECHNOLOGIES 3 1 3 4 IOCTL_GENERICIPAC_READ_U16 This function reads a buffer of 16 bit data values from a specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef struct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR ijpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The offset is specified in byte numitems This parameter specifies the number of 16 bit unsigned short values which shall be read from the specified address space The parameter oOutBuffer must pass a pointer to a buffer with a size of at least numitems 16 bit values The read data will be returned in this buffer EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes GENERICI
4. TENSES The Embedded I O Company TECHNOLOGIES CARRIER SW 65 Windows Device Driver IPAC Carrier Version 2 3 x User Manual Issue 2 3 0 January 2014 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek Germany Phone 49 0 4101 40580 Fax 49 0 4101 4058 19 e mail info tews com www tews com CARRIER SW 65 Windows Device Driver TEWS amp TECHNOLOGIES This document contains information which is proprietary to TEWS TECHNOLOGIES GmbH Any reproduction without written permission is forbidden IPAC Carrier TEWS TECHNOLOGIES GmbH has made any effort to ensure that this manual is accurate and complete 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 application or use of the device described herein 2003 2014 by TEWS TECHNOLOGIES GmbH Issue Description Date 1 0 First Issue October 22 2003 1 1 Description for Generic Driver added File list extended December 18 2003 1 2 Description for VME Support added Win XP Installation Description May 26 2004 added Win89 Me Installation Description removed 1 1 3 Description of Installation modified November 1 2004 1 1 4 File list changed July 13 2005 1 1 5 List of supported modules added file list changed July 03 2006 1 2 0 TAMC100 support added New address TEWS LLC May 23 2008 1 2 1 Files moved to subdirectory Jun
5. aaannnannnnnnnnnnnnnnnnnnnunnnnnnnnnnnunnnnnun mannanna 9 GENERIC IPAC DEVICE DRIVER 2 aaaaaaaaaaaaaaaaaaaaa nannnnnnnnnnnnnnnnannnnnnnnnnnnnnnnnnnnnnnn 10 3 1 Generic IPAC Files and I O Functions aaaaazaannaaaaaannnnnnnnnnunnnnnnnunnnnunnnnnnunnnnunnnnnnnnnununnnnnnnnnununnn 11 3 1 1 Opening a Generic IPAC Device aaaaaaaaaaaaaaaannnannnannnannnnnnnnnnnnnnnnnnnnnnnnnnnnannnansnansaannaai 11 3 1 2 Closing a Generic IPAC Device aaiaaaaaaasaaassnansaansnnnsnnnnnnnsnnnnnnnnnnnnannnannnnnnnnnnannnnnna 13 3 1 3 Generic IPAC Device I O Control Functions aniiaaaaaaaaiaaaaaaaaanasuananaananainaaaaaaaanaaaanaaaaa 14 3 1 3 1 IOCTL_GENERICIPAC CONFIGURE cccccccccsssecesececsesseaececeeeeessesseaeeeeeeseeenes 16 3 1 3 2 lOCTL_GENERICIPAC_UNCONFIGURE 2aiiaiia iii ia aanaaaaaaaaaa aaaaaaaaaaadaaaaaaaaadadaaaaaaaa 19 3 1 3 3 IOCTL_GENERICIPAC READ UB aniiaaiiaaaaaaaaaaaaaaaasaaaaaaaaanusnananaaaanudnaaaaaananuanaaaaaaa 21 3 1 3 4 IOCTL_GENERICIPAC READ U16 iiiiiiaaaaaaaaaaaa aaaaaaaaaaaaanasaaaaaaaaanasaaaanaaaanadaaaaaaaa 24 3 1 3 5 IOCTL_GENERICIPAC READ U32 aiiiiiaaiaaaaaaaaaa aaanaanaaaaaananaaaanaaaananaaaaaaaaanaaaaaaaaaa 27 3 1 3 6 IOCTL GENERICIPAC WRITE U8 aaiiaaiiaiaaaaaaaaaaaaaasaaaaaaaaa asaaaanaaaaasaaaaaaaaanaaaaaa 30 3 1 3 7 IOCTL_GENERICIPAC WRITE _U16 aiiaiiiaaaaaaaaaaaaaaasaaaaaaaaanasaaaanaaaanasaaaaaaaaanaaaana 32 3 1 3 8 IOCTL GENERICIP
6. interrupt process that handles interrupts for all process using the generic device This interrupt process may just handle the steps 4 and 5 in a loop 3 2 3 1 Interrupt Event Vectors If no interrupt vector is registered the generic driver will handle all interrupts that can be associated with the generic IPAC Without registering an interrupt vector no IACK cycle will be executed and there is no usable interrupt vector returned by the waiting function If at least one interrupt vector is registered the generic IPAC driver will execute an ACK cycle and will just handle interrupts of registered vectors Interrupt vectors may be useful if interrupts cannot be assigned to a unique IPAC slot e g detection limited by used carrier board If an IPAC needs an IACK cycle to clear the interrupt at least one vector must be registered CARRIER SW 65 Windows Device Driver Page 49 of 50 TEWS amp TECHNOLOGIES 3 2 3 2 Wait for Interrupt Handling Cycle The following steps describe how interrupts are handled with the generic IPAC device driver 1 application Execute wait for interrupt event blocking 2 generic driver I O request enable INTO and or INT1 3 IPAC generates interrupt INTx 4 generic driver ISR disable INTO and INT1 5 generic driver DPC get vector and unblock application 6 application acknowledge interrupt on IPAC release INTx CARRIER SW 65 Windows Device Driver Page 50 of
7. 5 IOCTL_GENERICIPAC_READ_U32 This function reads a buffer of 32 bit data values from a specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef struct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR ijpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The offset is specified in byte numitems This parameter specifies the number of 32 bit unsigned int values which shall be read from the specified address space The parameter oOutBuffer must pass a pointer to a buffer with a size of at least numitems 32 bit values The read data will be returned in this buffer EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes GENERICIPAC_TIO_PAR ioBuf unsigned int pBuffer int bufSize CARRIER SW 65 Windows Device Driver Page 27 of 50 TEWS amp TECHNOLOGIES Read 100 32 bit words from Memory space starting at address 0x10000 ioBuf ipacSpace GENERICIPAC_MEMSPACE i1oBuf offset
8. be mapped Maybe the specified IPAC space has not been mapped with IOCTL_GENERICIPAC_CONFIGURE All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 42 of 50 TENSE TECHNOLOGIES 3 1 3 13 IOCTL_GENERICIPAC_UNMAP_SPACE This function unmaps an IPAC address space that has been previously mapped with IOCTL_GENERIC_MAP_SPACE The parameter p nBuffer must pass a pointer to the mapped virtual address void The address must match the address IOCTL_GENERIC_MAP_SPACE has returned as argument ptr in the structure GENERICIPAC_MAP_PAR The parameter oOutBuffer is not used and should be NULL EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes void virtIpacAddr Map IPAC space virtIpacAddr Unmap space of generic IPAC success DeviceloControl hDevice ITOCTL_GENERICIPAC_UNMAP_SPACE amp virtIpacAddr sizeof virtIpacAddr NULL 0 amp NumBytes NULL if success success virtIpacAddr is no longer valid else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 43 of 50 TEWSS amp TECHNOLOGIES ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function c
9. buffer bufSize amp NumBytes NULL if success successful written else ErrorHandler Device I O control error process error ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and ninBufferSize of the DeviceloControl function call ERROR_INVALID_ADDRESS Specified space has not been allocated ERROR_NOACCESS Access exceeds limits of space ERROR _INVALID PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 31 of 50 TEWS amp TECHNOLOGIES 3 1 3 7 IOCTL_GENERICIPAC_WRITE_U16 This function writes a buffer of 16 bit data values to the specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef struct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR ijpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The
10. functions An interrupt event will be announced for registered interrupt vectors if at least one vector is registered If no vector has been registered any interrupt on the specified slot will be detected The parameter jJ p nBuffer must pass a pointer to the wait parameter buffer GENERICIPAC_WAIT_EVENT_PAR to the device driver typedef struct unsigned int flags int timeout GENERICIPAC_WAIT_EVENT_PAR flags This parameter is an OR ed value of flags specifying the wait job configuration The following flags can be specified Flags Description GENERICIPAC_FL_ENA_INTO Enable INTO pin of the IPAC slot and wait for interrupt GENERICIPAC_FL_ENA_INT1 Enable INT1 pin of the IPAC slot and wait for interrupt timeout This parameter specifies the timeout time in seconds If 1 is specified the function will wait without timeout The parameter oOutBuffer must pass a pointer to an unsigned char buffer where the last received interrupt vector will be stored if an event vector has been registered Otherwise the value is not valid EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes GENERICIPAC_WAIT_EVENT_PAR evBuf unsigned char retVector CARRIER SW 65 Windows Device Driver Page 38 of 50 register vectors optional Wait for interrupt event on INTO TEWS amp TECHNOLOGIES timeout after 30
11. installation the IPAC Carrier device driver will start immediately New Hardware found IPAC Carrier Install IPAC Carrier Driver For every IPAC Carrier Install IPAC Slot Driver J For every IPAC Slot Configure IPAC slots Select Generic Devices Install IPAC Driver For every installed IPAC CARRIER SW 65 Windows Device Driver Page 7 of 50 Hoddns sang 19111eE 9 Vdl 40 UONe je Su TEWSS TECHNOLOGIES 2 2 Confirming Driver Installation To confirm that the driver has been properly loaded perform the following steps 1 Open the Windows Device Manager a For Windows 2000 XP open the Control Panel from My Computer and click the System icon and choose the Hardware tab and then click the Device Manager button b For Windows 7 open the Control Panel from My Computer and then click the Device Manager entry 2 Click the in front of Embedded I O The driver TPCI100 IPAC Carrier Board should appear for each installed TEWS PCI carrier board TPCI100 should appear only for TCPI100 boards the name should match the installed carrier board type The driver TEWS IPAC Slot should appear for available IPAC slots If generic device is selected for an IPAC slot with a mounted IPAC the driver Generic IPAC mounted to should appear for the device Otherwise a device in the Device Manager generally below of Other Devices should appear for each mounted IP
12. seconds evBuf flags GENERICIPAC_FL_ENA_INTO Use INTO evBuf timeout 30 Timeout after 30 seconds success DeviceloControl hDevice IOCTL_GENERICIPAC_WATIT_FOR_EVENT amp evBuf sizeof GENERICIPAC_WAIT_EVENT_PAR amp retVector sizeof r amp NumByte NULL if success else ERROR CODES Error Code ERROR_INSUFFICIENT_ BUFFER ERROR_IO_DEVICE ERROR_BUSY ERROR_SEM_TIMEOUT ERROR_REQUEST_ABORTED etVector S printf received interrupt vector 0x 02x n retVector ErrorHandler Device I O control error process error Description The input or output buffer is too small Please check the parameter nOutBufferSize and nInBufferSize of the DeviceloControl function call Enabling interrupt failed There is already an active wait job for this generic IPAC device The specified timeout has passed without an interrupt event The wait job has been aborted All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 39 of 50 TEWS amp TECHNOLOGIES 3 1 3 11 IOCTL_GENERICIPAC_ABORT_WAIT This function aborts the interrupt event wait job on the specified generic IPAC device The waiting function will return an error ERROR_REQUEST_ABORTED The parameters p nBuffer and pOutBuffer are not used and should be set to NULL EXAMPLE include genericI
13. the installed IP by checking the ID Prom and tries to return data as big endian values If the IPAC uses mixed endianess between the spaces or the application needs little endian data this value can be used to correct the data endianess The parameter pOutBuffer must pass a pointer to an unsigned char buffer where the suggested basic interrupt vector 8 bit will be stored This interrupt vector may be used as the base value for the interrupt vectors used on the device This may be very helpful if the IPAC carrier board or driver can not recognize the IPAC slot generating the interrupt EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes GENERICIPAC_CONFIG_PAR confBuf UCHAR suggestediIntVector confBuf clockSpeed GENERICIPAC_8MHz 8MHz IP clock rate confBuf dataBusWidth GENERICIPAC_BUSWIDTH_16 Bus width 16 bit confBuf idSpaceSize 0x40 64 byte ID space siz confBuf swapIdData FALSE no swapping big endian confBuf ioSpaceSize 0x20 32 byte ID register space confBuf swaploData FALSE no swapping big endian confBuf memSpaceSiz 0x100000 1MB memory space confBuf swapMemData TRUE swap data CARRIER SW 65 Windows Device Driver Page 17 of 50 TEWSS amp TECHNOLOGIES configure and map IPAC Slot success DeviceloControl hDevice IOC
14. 0x10000 Starting offset ioBuf numItems 100 Allocate input buffer bufSize ioBuf numItems sizeof unsigned int pBuffer unsigned int malloc bufSize if pBuffer NULL handle allocation error success DeviceloControl hDevice TOCTL_GENERICIPAC_READ_U32 amp ioBuf sizeof GENERICIPAC_IO_PAR pBuffer bufSize amp NumBytes NULL if success printf MEM Data 0x 08x 0x 08x n pBuffer 0 pBuffer 1 else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 28 of 50 TEWS amp TECHNOLOGIES ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlinBufferSize of the DeviceloControl function call ERROR _INVALID_ ADDRESS Specified space has not been allocated ERROR_NOACCESS Access exceeds limits of space ERROR _INVALID_ PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 29 of 50 TEWS amp TECHNOLOGIES 3 1 3 6 IOCTL_GENERICIPAC_WRITE_U8 This function writes a buffer of 8 bit data values to the specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef s
15. 50
16. AC CARRIER SW 65 Windows Device Driver Page 8 of 50 TEWSS TECHNOLOGIES 2 3 Configure IPAC Carrier Identification TEWS IPAC Carrier driver supports naming installed IPAC Carrier devices This may be a helpful feature to identify an IPAC special slot in the system although an IPAC Carrier Board has been added or removed from the system since installation Once the board has been named this name will identify IPAC Carrier devices of the same type at this specific slot PCl slot compactPCl slot etc If a board has been removed and is inserted later back to this location the driver will use the configured naming again For setting the carrier name just open the properties of the carrier device using the Windows Device Manager Make a right click to the IPAC Carrier Board device and click Properties Change to the Carrier Properties tab and select a Carrier name After modifying the name and pressing OK the new configuration is stored and will be used after the next device restart To make a safe identification it is necessary that the assigned carrier names are unique for the system Remember that a device restart is necessary before the modifications are used Any IPAC carrier driver may request the slot location The driver will receive a name for the IPAC slot which is a concatenation of the specified Carrier Name and the name of the slot e g Slot A The IPAC drivers will generally su
17. AC WRITE U82 iaaiiaiiiaaaaaaaaaaaaaaasaaaaaaaaa asaanaaaaaanasuaaaaaaaanaaaana 34 3 1 3 9 IOCTL_GENERICIPAC REGISTER EVENT VECTOR Q cccccececceeceesesteaeeeeees 36 3 1 3 10 IOCTL_GENERICIPAC_WAIT FOR _EVENT ccccccccccccecsesssseeeeeeeeeesssseaeeeeees 38 3 1 3 11 IOCTL_ GENERICIPAC ABORT WAIT c ccccccccccessssecescesceesesseaeceseesesesssteaeeeeees 40 3 1 3 12 IOCTL_GENERICIPAC MAP_ SPACE cc cccccccccsesesseceseeececsesnsaeceeeesesessseaeeeeees 41 3 1 3 13 IOCTL_GENERICIPAC_UNMAP_SPACE iiiiiaiaaiaaaaaaaaaaaaaaaaaaaaasaaaaaaaaanasaaaaaaaaanaaaaaa 43 3 1 3 14 IlOCTL_GENERICIPAC_RESET_DEVICE aaiiaaiiaaaaaaaaaaaaaaaaaaaaananaanaaaaaaaaaaanaaaana 45 3 1 3 15 lOCTL_GENERICIPAC_LOCALIZE_IPAC iaiaiaaiaaaaaaaaaaaaaaaaaaaasaaaaaaaaaadaaaaaaaaanaaaaaa 47 3 2 Programming ANS secs sank l Taa aa cata KA K N ahead R Ka R vet A RAR EARE 48 3 2 1 Standard I O ACCeSS iiiaaaaiiaaiaaaaasaiaaaaaaaaasuaaaaaaaananuaaanaaaanaunaaaaaanananuaaanaaaanaaaaaannananaaaanaaaaa 48 3 2 2 Direct O ACCES Snoetie eae daa a iaaa e EA a a aAa Anaa 48 3 2 3 lInterr pt EVENS rrenan eieaeoeaii adian deda eraa reia aaia LTR 49 3 2 3 1 Interrupt Event Vectors aaaaaaaaaaaanasanaannnnannnnnnnnnnnunnnnnnnnnnnunnnnnnnnnnnusnnnnnnnnanusnnna 49 3 2 3 2 Wait for Interrupt Handling Cycle a2iiaaaaaaaaaassaassaassaassaasaaanaaanaaanaaanaaanaaansaanaannna 50 CARRIER SW 65 Windows Device Dr
18. ENERICIPAC_LOCALIZE_IPAC This function returns a character string which can be used for the IPAC localization The returned string is a concatenation of the Carrier Board name and the IPAC Slot Number See also 2 2 The parameter p nBuffer is not used and should be NULL The parameter oOutBuffer must pass a pointer to a buffer where the localization string char can be copied to If the specified buffer is too small the function will just return a string of the specified size so make sure that the supplied is sufficient EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes char locNameBuf 100 Get localization string success DeviceloControl hDevice ITOCTL_GENERICIPAC_LOCALIZE_TIPAC NULL 0 amp locNameBuf 100 buffer length 100 byte amp NumBytes NULL if success printf IPAC mounted to s n locNameBuf else ErrorHandler Device I O control error process error ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 47 of 50 TEWSS amp TECHNOLOGIES 3 2 Programming Hints This chapter describes necessary steps to use the features o
19. PAC_TIO_PAR ioBuf unsigned short pBuffer int bufSize CARRIER SW 65 Windows Device Driver Page 24 of 50 TEWS amp TECHNOLOGIES Read 16 16 bit words from ID space starting at address 0x00 ioBuf ipacSpace GENERICIPAC_IDSPACE i1oBuf offset 0x00 Starting offset ioBuf numItems 0x10 Allocate input buffer bufSize ioBuf numItems sizeof unsigned short pBuffer unsigned short malloc bufSize if pBuffer NULL handle allocation error success DeviceloControl hDevice IOCTL_GENERICIPAC_READ_U16 amp ioBuf sizeof GENERICIPAC_IO_PAR pBuffer bufSize amp NumBytes NULL if success printf ID Data 0x 04x 0x 04x n pBuffer 0 pBuffer 1 else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 25 of 50 TEWSS amp TECHNOLOGIES ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR _INVALID_ ADDRESS Specified space has not been allocated ERROR_NOACCESS Access exceeds limits of space ERROR_INVALID_ PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 26 of 50 TEWS amp TECHNOLOGIES 3 1 3
20. SUCCESS ULONG NumBytes GENERICIPAC_TIO_PAR ioBuf unsigned int buffer 3 0x11111111 0x22222222 0x33333333 int bufSize CARRIER SW 65 Windows Device Driver Page 34 of 50 TEWS amp TECHNOLOGIES Write the data of the buffer to Memory space starting at address 0x1000 loBuf ipacSpace GENERICIPAC_MEMSPACE ioBuf offset 0x1000 ioBuf numItems 3 Calculate size of buffer bufSize ioBuf numItems success DeviceloControl if success successful written Starting offset sizeof unsigned int hDevice IOCTL_GENERICIPAC_WRITE_U32 amp ioBuf sizeof GENERICIPAC_IO_PAR buffer bufSize amp NumBytes NULL else ErrorHandler Device I O control error process error ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and ninBufferSize of the DeviceloControl function call ERROR_INVALID_ADDRESS Specified space has not been allocated ERROR_NOACCESS Access exceeds limits of space ERROR_INVALID_PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 35 of 50 TEWS amp TECHNOLOGIES 3 1 3 9 IOCTL_GENERICIPAC_REGISTER_EVENT_VECTOR This function registers or unregisters an event vecto
21. TL_GENERICIPAC_CONFIGURE amp confBuf sizeof GENERICIPAC_CONFIG_PAR amp suggestedintVector sizeof suggestedIntVector amp NumBytes NULL if success printf Suggested interrupt vector 0x 02x n suggestedIntVector else ErrorHandler Device I O control error process error ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR_BUSY The IPAC slot has already been configured ERROR_INVALID_ADDRESS Mapping of IPAC slot space failed ERROR_INVALID_ PARAMETER Configuration of IPAC slot failed All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 18 of 50 TEWS amp TECHNOLOGIES 3 1 3 2 IOCTL_GENERICIPAC_UNCONFIGURE This function unmaps the allocated IPAC spaces and allows a reconfiguration of the IPAC slot The parameters o nBuffer and pOutBuffer are not used and should be set to NULL Before calling this function all user mapped spaces must be unmapped And the device should be configured in passive state Disable interrupts on hardware EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes unconfigure and unmap IPAC Slot ma success De
22. all ERROR _INVALID PARAMETER Invalid parameter specified virtual address is not valid All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 44 of 50 TEWS amp TECHNOLOGIES 3 1 3 14 IOCTL_GENERICIPAC_RESET_DEVICE This function executes an IPAC reset on the specified generic IPAC device This function will reset the IPAC slot and the mounted device will be reset ATTENTION The function will wait for the reset execution This time may be depending on the hardware some hundred milliseconds The parameters o nBuffer and pOutBuffer are not used and should be set to NULL EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes Rest mounted generic IPAC Rg success DeviceloControl hDevice IOCTL_GENERICIPAC_RESET NULL 0 NULL 0 amp NumBytes NULL if success success else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 45 of 50 TEWSS amp TECHNOLOGIES ERROR CODES Error Code Description ERROR_NOT_SUPPORTED Reset is not supported for the IPAC slot of the generic device All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 46 of 50 TEWS amp TECHNOLOGIES 3 1 3 15 IOCTL_G
23. e 20 2008 1 3 0 Support of IPAC ID PROM Type II VITA4 added October 17 2008 1 4 0 Description of IPDrvCustom Custom IPAC driver added December 23 2008 TAMC200 support added 2 0 0 General driver and manual update Windows 7 Support added September 9 2011 2 1 0 2 2 0 2 3 0 chapters of unsupported parts removed address TEWS LLC removed Installation for Windows 2000 modified Support for TAMC220 added Support for TPCE200 added Generic IPAC Driver Naming of carrier locations CARRIER SW 65 Windows Device Driver October 19 2011 July 31 2013 January 3 2013 Page 2 of 50 TEWSS amp TECHNOLOGIES Table of Contents INTRODUCTION kilsnssia ksnas askanssdasann nb snanasanandngninanunan nnannnananaak aandnan aa a 4 INSTALLATION aaaaaaaaanaaaaaaaa nanunnnnnnnnnnnnnnnnnnnnnnnnnnnnunnnnnnunnnnnnnnunnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnnnna 5 2 1 Software Installati n 1 1 2 1222k2ssndndanussssnnskasundunsu agunisu nganuk ussnub aa nannkgsnnnn da udtunksanannidni nansansnna 6 2 1 1 WWINGOWS T seas aaa dt 6 2 1 2 WINDOWS X LEO r E S Ee 6 2 1 3 Windows 2000 cirsio rana a aa aa 7 2 2 Confirming Driver Installation uaaa22nnaaaan aaa nanannnannnnnannnnnannnnnanNN NN NN NUN nn nnannn ann nn anna anam anna 8 2 3 Configure IPAC Carrier Identification na22uaaanaaaavaaannnannnnnnnnnnnnnnnunnnunnnanannnannnnnannnannnnn nana naan 9 2 4 Configure Generic IPAC Device Support uaaaaannaaaann
24. e by any process 2 Map IPAC address space s IOCTL_GENERICIPAC_MAP_SPACE must be done by every process context that shall access 3 Direct Read Write accesses are possible application process must have mapped the space 4 Un map IPAC address space s IOCTL_GENERICIPAC_UNMAP_SPACE must be done for every process that has mapped a space 5 Un configure generic device IOCTL_GENERICIPAC_UNCONFIGURE Must be called once by any process CARRIER SW 65 Windows Device Driver Page 48 of 50 TEWS amp TECHNOLOGIES 3 2 3 Interrupt Events The generic IPAC device driver supports interrupt event handling But this interrupt handling is limited and quite slow See below how interrupts can be used with the generic interrupt driver 1 Configure generic device IOCTL_GENERICIPAC_CONFIGURE Must be called once by any process 2 Make default configuration of the used IPAC 3 Register interrupt vector s optional IOCTL_GENERICIPAC_REGISTER_EVENT_VECTOR 4 Wait for interrupt event s IOCTL_GENERICIPAC_WAIT_FOR_INTEVENT 5 Clear interrupt application process must clear interrupt on IPAC INTx must be released 6 Un register interrupt vector s optional IOCTL_GENERICIPAC_REGISTER_EVENT_VECTOR 7 Un configure generic device IOCTL_GENERICIPAC_UNCONFIGURE Must be called once by any process Because the wait function is limited and can just be used once a time it may be useful to implement an
25. e parameter pOutBuffer must pass a pointer to a buffer with a size of at least num tems 8 bit values The read data will be returned in this buffer EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN success ULONG NumBytes GENERICIPAC_IO_PAR ioBuf unsigned char pBuffer int bufSize CARRIER SW 65 Windows Device Driver Page 21 of 50 TEWS amp TECHNOLOGIES Read 8 byte from IO space starting at address 0x10 ioBuf ipacSpace GENERICIPAC_IOSPACE ioBuf offset 0x10 Starting offset ioBuf numItems 8 Allocate input buffer bufSize ioBuf numItems sizeof unsigned char pBuffer unsigned char malloc bufSize if pBuffer NULL handle allocation error success DeviceloControl hDevice TOCTL_GENERICIPAC_READ_U8 amp ioBuf sizeof GENERICIPAC_IO_PAR pBuffer bufSize amp NumBytes NULL if success printf IO Data 0x 02x 0x 02x n pBuffer 0 pBuffer 1 else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 22 of 50 TEWSS amp TECHNOLOGIES ERROR CODES Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR _INVALID_ ADDRESS Specified space has not been allocated
26. eri386 cat tewspcicarrier inf tewsipacslotamd64 cat tewsipacsloti386 cat tewsipacslot inf genericipacamd64 cat genericipaci386 cat genericipac inf genericipac h genericipacExa c i386 amd64 CARRIER SW 65 2 3 0 pdf Release txt ChangeLog txt CARRIER SW 65 Windows Device Driver TENSE TECHNOLOGIES Installation tool for 32bit systems Windows XP or later Installation tool for 64bit systems Windows XP or later TEWS PCI IPAC Carrier Driver CAT File 64 bit TEWS PCI IPAC Carrier Driver CAT File 32 bit Windows installation script TEWS IPAC Slot Driver CAT File 64 bit TEWS IPAC Slot Driver CAT File 32 bit Windows installation script Generic IPAC Driver CAT File 64 bit Generic IPAC Driver CAT File 32 bit Windows installation script Application include File for Generic IPAC Driver Example Application for Generic IPAC Driver Directory containing driver files for 32bit Windows versions Directory containing driver files for 64bit Windows versions This document in PDF Format Information about the Device Driver Release Release history Page 5 of 50 TEWS amp TECHNOLOGIES 2 1 Software Installation 2 1 1 Windows 7 This section describes how to install the IPAC Carrier Device Driver software on a Windows 7 32bit or 64bit operating system Execute the matching installer application on the distribution media installer_32bit on a 32 bit system installer_64bit on a 64 bit system The insta
27. f generic IPAC devices 3 2 1 Standard I O Access The generic IPAC device driver provides functions which allow access to the IPAC address spaces These functions will always check if the access matches the specified space sizes These functions will prevent application and system crashes due to invalid hardware accesses Before any access to the IPAC can be executed the generic device must be configured by any process 1 Configure generic device IOCTL_GENERICIPAC_CONFIGURE Must be called once by any process 2 Read Write accesses can be called applications IOCTL_GENERICIPAC_READ_Ux IOCTL_GENERICIPAC_WRITE_Ux different processes may access the generic device as long as the slot has been configured properly 3 Un configure generic device IOCTL_GENERICIPAC_UNCONFIGURE Must be called once by any process 3 2 2 Direct I O Access The generic IPAC device driver allows direct access to the IPAC address spaces This map function will just supply an address and the size of a space The validation of accessed addresses is in the hand of the application Therefor there is no overhead caused by the O control functions Before any direct access to the IPAC can be executed the generic device must be configured by any process and the used space must be mapped for the application s process If the space is no longer used the space must be unmapped 1 Configure generic device IOCTL_GENERICIPAC_CONFIGURE Must be called onc
28. has not been allocated ERROR_NOACCESS Access exceeds limits of space ERROR_INVALID_PARAMETER Invalid parameter specified All other returned error codes are system error conditions CARRIER SW 65 Windows Device Driver Page 33 of 50 TEWS amp TECHNOLOGIES 3 1 3 8 IOCTL_GENERICIPAC_WRITE_U32 This function writes a buffer of 32 bit data values to the specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef struct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR ijpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The offset is specified in byte numitems This parameter specifies the number of 32 bit unsigned int values that shall be written to the specified address space The parameter oOutBuffer must pass a pointer to a buffer containing the write data The buffer must have at least the length of numitems 32 bit values EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN
29. ionDistribution Specifies which action to take on files that exist and which action to take when files that do not exist Generic IPAC devices must be always opened OPEN_EXISTING dwFlagsAndAttributes Specifies the file attributes and flags for the file This value must be set to 0 no overlapped I O hTemplateFile This value must be NULL for generic IPAC devices CARRIER SW 65 Windows Device Driver Page 11 of 50 TEWS amp TECHNOLOGIES RETURN VALUE If the function succeeds the return value is an open handle to the specified generic IPAC device If the function fails the return value is INVALID HANDLE VALUE To get extended error information call GetLastError EXAMPLE HANDLE hDevice hDevice CreateFile GenericIpac_1 GENERIC_READ GENERIC_WRITE 0 NULL no security attrs OPEN_EXISTING generic IPAC device always open existing 0 no overlapped I O NULL if hDevice INVALID HANDLE VALUE ErrorHandler Could not open device process error SEE ALSO CloseHandle Win32 documentation CreateFile CARRIER SW 65 Windows Device Driver Page 12 of 50 TEWS amp TECHNOLOGIES 3 1 2 Closing a Generic IPAC Device The CloseHandle function closes an open generic IPAC device handle BOOL CloseHandle HANDLE hDevice handle to a generic IPAC device to close PARAMETERS hDevice Identifies an ope
30. iver Page 3 of 50 TEWS amp TECHNOLOGIES 1 Introduction IndustryPack IPAC carrier boards have different implementations of the system to IndustryPack bus bridge logic different implementations of interrupt and error handling and so on To simplify the implementation of IPAC device drivers which shall work with any supported carrier board TEWS TECHNOLOGIES has designed a software architecture that hides all of these carrier board differences under a well defined interface The CARRIER SW 65 device driver supports the modules listed below TPCI100 TEWS Carrier for 2 IndustryPack modules PCI TPCI200 TEWS Carrier for 4 IndustryPack modules PCI TCP201 TEWS Carrier for 4 IndustryPack modules compactPCl TCP211 TEWS Carrier for 2 IndustryPack modules compactPCl TCP212 TEWS Carrier for 2 IndustryPack modules compactPCl TCP213 TEWS Carrier for 2 IndustryPack modules compactPCl TCP220 TEWS Carrier for 4 IndustryPack modules compactPCl TAMC100 TEWS Carrier for 1 IndustryPack modules AMC TAMC200 TEWS Carrier for 3 IndustryPack modules AMC TAMC220 TEWS Carrier for 3 IndustryPack modules AMC TPCE200 TEWS Carrier for 4 IndustryPack modules PClexpress CARRIER SW 65 Windows Device Driver Page 4 of 50 2 Installation Following files are located in directory CARRIER SW 65 on the distribution media installer_32bit exe installer_64bit exe tewspcicarrieramd64 cat tewspcicarri
31. ller will install all required driver files using an installation wizard After the Installation all drivers on the distribution media are available on the target system and the carrier devices and the slot devices should start Device entries for the installed IPAC boards should be created and shown in the device manager If generic devices are enabled special configuration of an IPAC slot see also 2 4 the device will be started immediately restarting the IPAC slot 2 1 2 Windows XP This section describes how to install the IPAC Carrier Device Driver software on a Windows XP 32bit operating system Execute the matching installer application installer_32bit on the distribution media The installer will install all required driver files using an installation wizard Do not install any driver using the new Device found requester After the Installation all drivers on the distribution media are available on the target system and the carrier devices and the slot devices should start If devices do not start automatically during installation execute the installer application again Device entries for the installed IPAC boards should be created and shown in the device manager If generic devices are enabled special configuration of an IPAC slot see also 2 4 the device will appear in the device manager after restarting the IPAC slot The devices will not start immediately and the installer must be executed once again Afte
32. n generic IPAC device handle RETURN VALUE If the function succeeds the return value is nonzero If the function fails the return value is zero To get extended error information call GetLastError EXAMPLE HANDLE hDevice hDevice CreateFile if CloseHandle hDevice ErrorHandler Could not close device process error SEE ALSO CreateFile Win32 documentation CloseHandle CARRIER SW 65 Windows Device Driver Page 13 of 50 TEWS amp TECHNOLOGIES 3 1 3 Generic IPAC Device I O Control Functions The DeviceloControl function sends a control code directly to a specified device driver causing the corresponding device to perform the specified operation BOOL DeviceloControl HANDLE hDevice DWORD dwloControlCode LPVOID pIinBuffer DWORD n nBufferSize LPVOID pOutBuffer DWORD nOutBufferSize LPDWORD pBytesReturned LPOVERLAPPED pOverlapped PARAMETERS hDevice handle to device of interest control code of operation to perform pointer to buffer to supply input data size of input buffer pointer to buffer to receive output data size of output buffer pointer to variable to receive output byte count pointer to overlapped structure for asynchronous operation Handle to the generic IPAC that is to perform the operation dwloControlCode Specifies the control code for an operation This value identifies the specific operation to be
33. ns for interaction with the Generic IPAC device driver Only the required parameters are described in detail 3 1 1 Opening a Generic IPAC Device Before you can perform any I O the generic IPAC device must be opened by invoking the CreateFile function CreateFile returns a handle that can be used to access the generic IPAC device HANDLE CreateFile LPCTSTR pFileName pointer to filename DWORD awDesiredAccess access read write mode DWORD awShareMode share mode LPSECURITY_ATTRIBUTES pSecurityAttributes pointer to security attributes DWORD awCreationDistribution how to create DWORD awFlagsAndAttributes file attributes HANDLE hTemplateFile handle to file with attributes to copy PARAMETERS lpFileName Pointer to a null terminated string that specifies the name of the generic IPAC to open The pFileName string should be of the form Genericlpac_x to open the device x The ending x is a one based number The first device found by the driver is Genericlpac_1 the second Genericlpac_2 and so on dwDesiredAccess Specifies the type of access to the generic IPAC For the generic IPAC this parameter must be set to read write access GENERIC_READ GENERIC_WRITE dwShareMode A set of bit flags that specifies how the object can be shared for read and write Unimportant for generic IPAC devices set to 0 lpSecurityAttributes Pointer to a security structure Set to NULL for generic IPAC devices dwCreat
34. ny of the other functions The parameter J pinBuffer must pass a pointer to the configuration buffer GENERICIPAC_CONFIG_PAR to the device driver typedef struct BOOLEAN clockSpeed BOOLEAN dataBusWidth unsigned int idSpaceSize BOOLEAN swapldData unsigned int ioSpaceSize BOOLEAN swaploData unsigned int memSpaceSize BOOLEAN swapMem Data GENERICIPAC_CONFIG_PAR clockSpeed This parameter configures the IP clock rate If 32MHz is configured but not supported by the carrier board 8MHz will be used The following defines shall be used for configuration Define Description GENERICIPAC_8MHz configure 8MHz IP Clock Speed GENERICIPAC_32MHz configure 32MHz IP Clock Speed dataBus Width This parameter specifies the IP data bus width for memory space access If the requested data bus width is not available the supported bus width will be used The following defines shall be used for bus width configuration Define Description GENERICIPAC_BUSWIDTH_8 configure IPAC slot for 8 bit data bus width GENERICIPAC_BUSWIDTH_16 configure IPAC slot for 16 bit data bus width idSpaceSize This parameter specifies the size of ID address space supported on the IPAC If this space shall not be used or is not supported the size shall be set to 0 swaplaData This parameter specifies if the 16 bit and 32 bit access functions shall swap the data values of the ID space TRUE enables byte swapping FALSE disables the swapping Generall
35. offset is specified in byte numitems This parameter specifies the number of 16 bit unsigned short values that shall be written to the specified address space The parameter oOutBuffer must pass a pointer to a buffer containing the write data The buffer must have at least the length of numitems 16 bit values EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes GENERICIPAC_TO_PAR ioBuf unsigned short buffer 3 0x1111 0x2222 0x3333 int bufSize CARRIER SW 65 Windows Device Driver Page 32 of 50 TEWS amp TECHNOLOGIES Write the data of the buffer to I0 space starting at address 0x8 loBuf ipacSpace GENERICIPAC_IOSPACE ioBuf offset 0x8 3 ioBuf numItems Calculate size of buffer bufSize ioBuf numItems success DeviceloControl if success successful written else ERROR CODES Starting offset sizeof unsigned short hDevice IOCTL_GENERICIPAC_WRITE_U16 amp ioBuf sizeof GENERICIPAC_IO_PAR buffer bufSize amp NumBytes NULL ErrorHandler Device I O control error process error Error Code Description ERROR_INSUFFICIENT_BUFFER The input or output buffer is too small Please check the parameter nOutBufferSize and nlnBufferSize of the DeviceloControl function call ERROR_INVALID_ADDRESS Specified space
36. pac h HANDLE hDevice BOOLEAN success ULONG NumBytes abort wait job success DeviceloControl hDevice IOCTL_GENERICIPAC_ABORT_WAIT NULL 0 NULL 0 amp NumBytes NULL if success success else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 40 of 50 TENSE TECHNOLOGIES 3 1 3 12 IOCTL_GENERICIPAC_MAP_SPACE This function maps a specified IPAC address space into the application environment The function will return a virtual address that can be used for direct access of IPAC registers and memory The function will always map the complete size of the IPAC address space as it has been configured with IOCTL_GENERICIPAC_CONFIGURE Virtual addresses allow full access to the device the application has to care about the limits of the IPAC spaces and endianess Mapped spaces should always be unmapped before leaving the application The parameter p nBuffer must pass a pointer to an unsigned int value The value specifies the IPAC space that shall be mapped The following defines must be used for space selection Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space The parameter oOutBuffer must pass a pointer to a map buffer GENERICIPAC_MAP_PAR where mapping information will be returned typedef struct
37. performed The following values are defined in genericlpac h Value IOCTL_GENERICIPAC_CONFIGURE IOCTL_GENERICIPAC_UNCONFIGURE IOCTL_GENERICIPAC_READ_U8 IOCTL_GENERICIPAC_READ_U16 IOCTL_GENERICIPAC_READ_U32 IOCTL_GENERICIPAC_WRITE_U8 IOCTL_GENERICIPAC_WRITE_U16 IOCTL_GENERICIPAC_WRITE_U32 continued CARRIER SW 65 Windows Device Driver Meaning Configure IPAC slot and map IPAC register spaces Remove IPAC register space mapping Read a buffer of 8 bit data from an IPAC space Read a buffer of 16 bit data from an IPAC space Read a buffer of 32 bit data from an IPAC space Write a buffer of 8 bit data to an IPAC space Write a buffer of 16 bit data to an IPAC space Write a buffer of 32 bit data to an IPAC space continued Page 14 of 50 TENSE TECHNOLOGIES Value Meaning IOCTL_GENERICIPAC_REGISTER_EVENT_VECTOR Register an interrupt vector that shall be handled by the device IOCTL_GENERICIPAC_WAIT_FOR_EVENT Wait for an interrupt event IOCTL_GENERICIPAC_ABORT_WAIT Abort an ioctl call waiting for an interrupt event IOCTL_GENERICIPAC_MAP_SPACE Map an IPAC space into the users process Allow direct access IOCTL_GENERICIPAC_UMMAP_SPACE Un map an user mapped IPAC space IOCTL_GENERICIPAC_RESET_DEVICE Execute a an IPAC reset IOCTL_GENERICIPAC_LOCALIZE_IPAC Read the localization name of the IPAC slot See behind for more detailed information on each control code To use these gene
38. pport a function which reads out the identification string The returned character string will look like lt Carrier Name gt Slot lt n gt e g MyCarrier Slot B 2 4 Configure Generic IPAC Device Support It may be necessary to use IPACs which have no driver support matching to the TEWS carrier driver software CARRIER SW 65 or the available driver does not support the necessary functions The carrier driver software offers a generic IPAC driver which provides full access to the device resources of any IPAC If the generic IPAC driver should be used for a mounted IPAC the IPAC slot must be configured to create a generic device for this slot Therefore make a right click to the TEWS IPAC Slot device and click Properties Change to the Properties of the IPAC Slot tab and select Generic IPAC Slot Name After pressing OK the configuration is stored and will be used after the next device restart Remember that a device restart is necessary before the modifications are used After modification and restart the system may request a driver for the generic IPAC device If the driver is not automatically started the driver can be installed following the instructions of chapter 2 1 1 2 1 2 or 2 1 3 CARRIER SW 65 Windows Device Driver Page 9 of 50 TEWS amp TECHNOLOGIES 3 Generic IPAC Device Driver The Generic IPAC Driver allows the use of IPAC boards where driver support is not available or doe
39. r that the generic devices should start and are available for use CARRIER SW 65 Windows Device Driver Page 6 of 50 TEWS amp TECHNOLOGIES 2 1 3 Windows 2000 This section describes how to install the IPAC Carrier Device Drivers on a Windows 2000 operating system After installing the IPAC Carrier board s and boot up your system Windows 2000 setup will show a New hardware found dialog box 1 The Upgrade Device Driver Wizard dialog box will appear on your screen Click Next button to continue 2 In the following dialog box choose Search for a suitable driver for my device Click Next button to continue 3 Insert the IPAC Carrier driver media and select Disk Drive in the dialog box Click Next button to continue 4 Now the driver wizard should find a suitable device driver on the installation media Click Next button to continue 5 Completing the upgrade device driver and click Finish to take all the changes effect 6 If the system requests a restart the system should be restarted after all pending device driver installation requests have been handled 7 Repeat the Instructions until drivers for all IPAC Carrier Boards are installed 8 Now Generic IPAC support can be configured for the IPAC slots see 2 4 9 The next step to do is to install the IPAC Slot Drivers Simply repeat the above steps 10 Now copy all needed files to the desired target directories After successful
40. r to the interrupt handler of the specified generic IPAC device If a vector is registered the driver will request an interrupt vector from the generic IPAC device hence an IACK cycle will be executed to the IPAC This may also be necessary if the IPAC clears the interrupt with an IACK cycle The specified vector must match the vector the IPAC will return with the IACK cycle otherwise the event will not be announced and the interrupt may not be handled correctly The parameter J plnBuffer must pass a pointer to the configuration buffer GENERICIPAC_REGISTER_EVENT_VECTOR_PAR to the device driver typedef struct unsigned int action unsigned char intVectorNo GENERICIPAC_REGISTER_EVENT_VECTOR_PAR action This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Action Description GENERICIPAC_REGISTER Register the specified vector to be handled for the IPAC GENERICIPAC_UNREGISTER Remove the specified vector from interrupt event handling intVectorNo This parameter specifies the interrupt vector only 8 bit vectors are supported Valid vector numbers are 1 up to 254 0 is no valid vector number 255 is used internally The parameter oOutBuffer is unused and should be NULL EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCeSS ULONG NumBytes GENERICIPAC_REGISTER_EVENT_VECTOR_PAR vecBuf
41. ric IPAC specific control codes the header file genericlpac h must be included in the application lolnBuffer Pointer to a buffer that contains the data required to perform the operation nlnBufferSize Specifies the size in bytes of the buffer pointed to by lplnBuffer lpOutBuffer Pointer to a buffer that receives the operation s output data nOutBufferSize Specifies the size in bytes of the buffer pointed to by oOutBuffer lpBytesReturned Pointer to a variable that receives the size in bytes of the data stored into the buffer pointed to by oOutBuffer A valid pointer is required lpOverlapped Pointer to an Overlapped structure This value must be set to NULL no overlapped I O RETURN VALUE If the function succeeds the return value is nonzero If the function fails the return value is zero To get extended error information call GetLastError SEE ALSO Win32 documentation DeviceloControl CARRIER SW 65 Windows Device Driver Page 15 of 50 TEWS amp TECHNOLOGIES 3 1 3 1 IOCTL_GENERICIPAC_CONFIGURE This function sets up the IPAC slot parameters IPAC clock speed and bus access size and specifies the size of the IPAC address spaces and maps them to the device The function returns a base interrupt vector that is suggested to be used for the device The generic IPAC device must be configured before any other access to the device is allowed Therefore this function should be called first before a
42. s not match to the CARRIER SW 65 support The generic IPAC driver is a kernel mode driver which allows the operation of IPAC devices on the Windows operating system The standard file and device I O functions CreateFile CloseHandle and DeviceloControl provide the basic interface for opening and closing a device handle and for performing device I O control operations Because the generic IPAC device driver is stacked on the TEWS TECHNOLOGIES IPAC Carrier Driver it is necessary to install also the appropriate IPAC carrier driver The generic IPAC device driver includes the following functions configuration of IPAC slot parameters clock speed bus width configuration of IPAC parameters ID IO Memory space size and endianess reading and writing of all IPAC spaces ID IO and Memory Space reads and writes with access size of 8 16 and 32 bit special support of interrupt events with and without vector mapping of address spaces into the process context of the user application resetting IPAC slot reading the IPAC slot localization identifier unique IPAC slot name VVVVVVVV If a device should be used as a generic device it is necessary that the IPAC slot device is configured for generic device support See 2 4 CARRIER SW 65 Windows Device Driver Page 10 of 50 TEWSS TECHNOLOGIES 3 1 Generic IPAC Files and I O Functions The following section doesn t contain a full description of the Win32 functio
43. truct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR ijpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The offset is specified in byte numitems This parameter specifies the number of 8 bit unsigned char values that shall be written to the specified address space The parameter oOutBuffer must pass a pointer to a buffer containing the write data The buffer must have at least the length of numitems 8 bit values EXAMPLE include genericIpac h HANDLE hDevice BOOLEAN SUCCESS ULONG NumBytes GENERICIPAC_TO_PAR ioBuf unsigned char buffer 4 0x11 0x22 0x33 0x44 int bufSize CARRIER SW 65 Windows Device Driver Page 30 of 50 TEWS amp TECHNOLOGIES Write the data of the buffer to I0 space starting at address 0x16 loBuf ipacSpace GENERICIPAC_IOSPACE i1oBuf offset 0x16 Starting offset ioBuf numItems 4 Calculate size of buffer bufSize ioBuf numItems sizeof unsigned char success DeviceloControl hDevice IOCTL_GENERICIPAC_WRITE_U8 amp ioBuf sizeof GENERICIPAC_IO_PAR
44. viceloControl hDevice IOCTL_GENERICIPAC_UNCONFIGURE NULL 0 NULL 0 amp NumBytes NULL if success success else ErrorHandler Device I O control error process error CARRIER SW 65 Windows Device Driver Page 19 of 50 TEWSS amp TECHNOLOGIES ERROR CODES All returned error codes are system error conditions Error Code Description ERROR_DEVICE_IN_USE There are active user mapped spaces CARRIER SW 65 Windows Device Driver Page 20 of 50 TEWS amp TECHNOLOGIES 3 1 3 3 IOCTL_GENERICIPAC_READ_U8 This function reads a buffer of 8 bit data values from a specified address space of the generic IPAC device The parameter p nBuffer must pass a pointer to the I O access buffer GENERICIPAC_IO_PAR to the device driver typedef struct unsigned int ipacSpace unsigned int offset unsigned int numltems GENERICIPAC_IO_PAR jpacSpace This parameter specifies the IPAC address space that shall be accessed The following address spaces are defined Define Description GENERICIPAC_IDSPACE Access ID space GENERICIPAC_IOSPACE Access IO space GENERICIPAC_MEMSPACE Access memory space offset This parameter specifies the address starting offset inside the specified address space The offset is specified in byte numitems This parameter specifies the number of 8 bit unsigned char values which shall be read from the specified address space Th
45. y the IPAC carrier driver tries to identify the endianess of the installed IPAC by checking the ID Prom and tries to return data as big endian values If the IPAC uses mixed endianess between the spaces or the application needs little endian data this value can be used to correct the data endianess CARRIER SW 65 Windows Device Driver Page 16 of 50 TEWS amp TECHNOLOGIES ioSpaceSize This parameter specifies the size of lO address space supported on the IPAC If this space shall not be used or is not supported the size shall be set to 0 swaploData This parameter specifies if the 16 bit and 32 bit access functions shall swap the data values of the lO space TRUE enables byte swapping FALSE disables the swapping Generally the IPAC carrier driver tries to identify the endianess of the installed IP by checking the ID Prom and tries to return data as big endian values If the IPAC uses mixed endianess between the spaces or the application needs little endian data this value can be used to correct the data endianess memSpaceSize This parameter specifies the size of Memory space supported on the IPAC If this space shall not be used or is not supported the size shall be set to 0 swapMemData This parameter specifies if the 16 bit and 32 bit access functions shall swap the data values of the memory space TRUE enables byte swapping FALSE disables the swapping Generally the IPAC carrier driver tries to identify the endianess of

Download Pdf Manuals

image

Related Search

Related Contents

attention - Jacobsen  Descargar Manual de Usuario  Philips Smart All-in-One S231C4AFD  HP ENVY x360 15-u111dx  Kenroy Home 53200ZC Installation Guide  Valcom MultiPath Talkback    INSTRUCTIONS D`UTILISATION  REFRIGERATOR SERVICE MANUAL  

Copyright © All rights reserved.
Failed to retrieve file