Technical description Chapter 9
PA 3110
39
e) Example in C for Windows NT / 95 (synchronous mode)
typedef struct
{
unsigned int ui_SaveArray [16];
/* Global Buffer */
unsigned int ui_TimerIntCpt ;
/* Timer interrupt counter */
unsigned char b_ReceiveInterrupt ;
/* Interrupt flag */
}str_UserStruct;
str_UserStruct *ps_GlobalUserStruct;
_VOID_ v_InterruptRoutine (BYTE_ b_BoardHandle,BYTE_ b_InterruptMask,
PUINT_ pui_ValueArray,
BYTE_ b_UserCallingMode,VOID *pv_UserSharedMemory)
{
unsigned int ui_Cpt;
unsigned short int *pusi_Index;
str_UserStruct *ps_UserStruct = (str_UserStruct *) pv_UserSharedMemory;
pusi_Index = (unsigned short int *) pui_ValueArray;
if ((b_InterruptMask&1) == 1) /* EOC interrupt */
{
ps_UserStruct->ui_SaveArray[0] = pui_ValueArray[1];
}
if ((b_InterruptMask&2) == 2) /* Timer conversion interrupt Acquisition */
{
for (ui_Cpt=0; ui_Cpt < pusi_Index[0]; +)
ps_UserStruct->ui_SaveArray [ui_Cpt] = pusi_Index[ui_Cpt];
}
if ((b_InterruptMask&4) == 4) /* EOS interrupt Acquisition */
{
for (ui_Cpt=0; ui_Cpt < pusi_Index[0]; +)
ps_UserStruct->ui_SaveArray [ui_Cpt] = pusi_Index[ui_Cpt];
}
if ((b_InterruptMask&8) == 8) /* DMA completed */
{
for (ui_Cpt=0;ui_Cpt<16;+)
ps_UserStruct->ui_SaveArray [ui_Cpt] = pusi_Index[ui_Cpt];
}
if ((b_InterruptMask&16) == 16) /* Timer 2 has run down */
{
ps_UserStruct->ui_TimerIntCpt = ps_UserStruct->ui_Timer 1;
}
if ((b_InterruptMask&32) == 32) /* Watchdog has run down */
{
ps_UserStruct->ui_TimerIntCpt = ps_UserStruct->ui_Timer 1;
}
i_PA3110_KRNL_Write1AnalogValue (0x300, 0, pui_ValueArray[1]);
ps_UserStruct->b_ReceiveInterrupt =ps_UserStruct->b_ReceiveInt 1;
}
Содержание ADDIALOG PA 3110
Страница 12: ...PA 3110 Technical descriptioin Chapter 3 4 3 HANDLING THE BOARD Fig 3 1 Wrong handling Fig 3 2 Correct handling...
Страница 18: ...PA 3110 Technical description Chapter 5 10 5 SETTINGS 5 1 Component scheme Fig 5 1 Component scheme...
Страница 33: ...Technical description Chapter 7 PA 3110 25 Fig 7 3 37 pin SUB D male connector X20 differential mode...
Страница 35: ......