int adcItrpEnable(register ADC_ID pAdcId) /* ADC_ID pAdcId; ADC Object */ { if (pAdcId == NULL) return(ERROR); pAdcId->adcControl |= BIT_MASK(ADC_EN_ITRP); *ADC_REG(ADC_CR,pAdcId->adcBaseAddr) = pAdcId->adcControl; sysIntEnable(pAdcId->vmeItrLevel); }
/* * enable VME interrupt level */ static long vxDevEnableInterruptLevelVME (unsigned level) { # if CPU_FAMILY != I80X86 int s; s = sysIntEnable (level); if (s!=OK) { return S_dev_intEnFail; } return 0; # else return S_dev_intEnFail; # endif }
INLINE void vmeio_int_enable(const DWORD base_adr, int intnum) /**************************************************************\ Purpose: Enable the interrupt for the bitwise input intnum (0xff). The interrupt vector is then the VECTOR_BASE+intnum Input: DWORD * base_addr : base address of the VMEIO DWORD * intnum : interrupt number (input 0:7) Output: none Function value: none \**************************************************************/ { volatile DWORD *spec_adr; spec_adr = (DWORD *) (A32D24 + base_adr) + (ENABLE_INT); *spec_adr = (intnum & 0xff); #ifdef OS_VXWORKS sysIntEnable(7); /* interrupt level 7 */ #endif }
/************ INLINE function for General command ***********/ INLINE void sis3803_int_attach(const DWORD base_adr, DWORD base_vect, int level, void (*isr) (void)) /**************************************************************\ Purpose: Book an ISR for a bitwise set of interrupt input (0xff). The interrupt vector is then the VECTOR_BASE+intnum Input: DWORD * base_addr : base address of the sis3803 DWORD base_vect : base vector of the module int level : IRQ level (1..7) DWORD isr_routine : interrupt routine pointer Output: none Function value: none \**************************************************************/ { volatile DWORD *spec_adr; /* disable all IRQ sources */ /* Should be done but not in attach sis3803_int_source(base_adr , DISABLE_IRQ_DI_BS0 | DISABLE_IRQ_DI_BS1 | DISABLE_IRQ_DI_BS2); */ #ifdef OS_VXWORKS if ((level < 8) && (level > 0) && (base_vect < 0x100)) { spec_adr = (DWORD *) (A32D24 + base_adr + IRQ_REG); *spec_adr = (level << 8) | VME_IRQ_ENABLE | base_vect; sysIntEnable(level); /* interrupt level */ } intConnect(INUM_TO_IVEC(base_vect), (VOIDFUNCPTR) isr, 0); #else printf("Not implemented for this OS\n"); #endif }