/****************************************************************************** * * Title : vmeHpiUtility.h * Version 0.0 * * Description: vmeHpiUtility.c header. * Related files: commonCommuicationLoop.c, * mainUir.c (mainThread) - pause+abort bits are sent to * vmeCommandReg directly from UserInterface!! * * Changes: March 7, 2002 - HPI access only D32 * * Author: Lukas Tomasek, tomasekl@fzu.cz * ******************************************************************************/ #ifndef VME_HPI_UTILITY_H /* multiple-inclusion protection */ #define VME_HPI_UTILITY_H /****************************************************************************** * Header files * ******************************************************************************/ #include "processor.h" #include "errorCodesRcc.h" /****************************************************************************** * Type definitions * ******************************************************************************/ /****************************************************************************** * Definitions * ******************************************************************************/ /* access parameters for VXI functions - A32 address space, address autoincrement, PIO instead of DMA */ #define A32_MOTOROLA_AUTOINCREMENT 0x0803 #define A32_INTEL_AUTOINCREMENT 0x0883 /* access parameters for VXI functions - A32 address space, address autoincrement, PIO ! */ #define A32_MOTOROLA_AUTOINCREMENT_DMA 0x0003 #define A32_INTEL_AUTOINCREMENT_DMA 0x0083 /* access parameters for VXI functions - A32 address space, no address increment, PIO instead of DMA */ #define A32_MOTOROLA_NO_INCREMENT 0x1803 #define A32_INTEL_NO_INCREMENT 0x1883 /* access parameters for VXI functions - A32 address space, no address increment, PIO ! */ #define A32_MOTOROLA_NO_INCREMENT_DMA 0x1003 #define A32_INTEL_NO_INCREMENT_DMA 0x1083 /* access parameters for VXI functions - A32 address space */ #define A32_MOTOROLA 0x0083 /* according to NI documentation it's actually Intel, but for VXEin() and VXIout() it really is Motorola!!! */ #define A32_INTEL 0x0003 /* access parameters for VXI functions - Local Address Space, Intel */ #define A32_LOCAL_INTEL 0x80 //-------------------- #define READ 0 #define WRITE 1 #define VME_ADDR_AUTOINCREMENT 0 #define NO_VME_ADDR_AUTOINCREMENT 1 /* fifo access */ #define HPIA_AUTOINCREMENT 0 #define NO_HPIA_AUTOINCREMENT 1 /* fifo access */ #define BLOCK_ACCESS 0 #define NO_BLOCK_ACCESS 1 /* don't use block VME access, for example TIM */ /* slave HPI addresses in master DSP memory space - 32 bit access */ #define SLAVE_HPI_BASE_ADDR(slaveNumber) (0x00780000+0x00020000*(slaveNumber)) /* = base_address+offset*slaveNumber */ #define SLAVE_HPIC_OFFSET 0x00 #define SLAVE_HPIA_OFFSET 0x04 #define SLAVE_HPID_AUTOINC_OFFSET 0x08 #define SLAVE_HPID_OFFSET 0x0C /****************************************************************************** * Global Function Declarations * ******************************************************************************/ ERROR_ID RWvmeBlock(int writeNotRead, UINT32 vmeAddr, UINT32 *buffer, UINT32 numberOfElements, UINT16 elementSizeInBytes, int noVmeAddressIncrement, int noBlockAccess, int vmeDma); ERROR_ID vmeReadElement(UINT32 vmeAddr, void *value, UINT16 elementSizeInBytes); ERROR_ID vmeWriteElement(UINT32 value, UINT32 vmeAddr, UINT16 elementSizeInBytes); ERROR_ID RWslave(int writeNotRead, UINT8 slotNumber, UINT8 slaveNumber, UINT32 dspAddr, UINT32 *buffer, UINT32 wordCount, int vmeDma); ERROR_ID RWmaster(int writeNotRead, UINT8 slotNumber, UINT32 dspAddr, UINT32 *buffer, UINT32 wordCount, int noAddressIncrement, int vmeDma); ERROR_ID setHpicMaster(UINT8 slotNumber); ERROR_ID setHpicSlave(UINT8 slotNumber, UINT8 slaveNumber); /******************************************************************************/ #endif /* VME_HPI_UTILITY_H */