Integrator Resources

The official home for NAI Support

Not sure where to start? Try Quick Start Guide or ask a question below!

Toggle Components with Visual Button
JavaScript Form Processing

DIF Interrupts

DIF Interrupts

Explanation

About The Code

This sample C application demonstrates how to configure and handle Discrete Input/Output Function (DIF) interrupts using North Atlantic Industries' (NAI) embedded function modules. Below is a detailed walkthrough and explanation of the code.

Definitions and Includes

The program begins by including necessary standard libraries and specific NAI libraries:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>

/* Common Sample Program include files */
#include "include/naiapp_interrupt.h"
#include "include/naiapp_interrupt_ether.h"
#include "include/naiapp_boardaccess_menu.h"
#include "include/naiapp_boardaccess_query.h"
#include "include/naiapp_boardaccess_access.h"
#include "include/naiapp_boardaccess_display.h"
#include "include/naiapp_boardaccess_utils.h"

/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
#include "functions/naibrd_dif.h"
#include "advanced/nai_ether_adv.h"

Constants and Function Prototypes

Several constants and function prototypes are declared for later use:

static const int8_t *CONFIG_FILE = (int8_t *)"default_DIF_Interrupts.txt";
/* Function prototypes */
void Run_DIF_Interrupts(int32_t cardIndex, int32_t module, int32_t ModuleID);
void Cfg_DIF_Interrupt_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel);
void Setup_DIF_Interrupt(int32_t cardIndex, int32_t module, uint32_t channel, uint32_t ModuleID);
#if !defined (RUN_ISR)
static void checkForStatusChange(int cardIndex, int module);
#endif
void MyDIFIsr(void* param,uint32_t vector);

/* Interrupt Vectors */
#define DIF_BIT_INTERRUPT_VECTOR 0x20
#define DIF_LO_HI_TRANS_INTERRUPT_VECTOR 0x21
#define DIF_HI_LO_TRANS_INTERRUPT_VECTOR 0x22

Global Variables

Global variables keep track of interrupt statuses and counts.

uint32_t irqDIFCount = 0;
static uint32_t receivedVector = 0;
static bool_t bReceivedBITInterrupt = FALSE;
static bool_t bReceivedLoHiTransInterrupt = FALSE;
static bool_t bReceivedHiLoTransInterrupt = FALSE;

static const int32_t DEF_DIF_CHANNEL = 1;

Main Function

Based on the platform (e.g., Windows, Linux, or VxWorks), the main entry point is specified:

#if defined (__VXWORKS__)
int32_t DIF_Interrupts(void)
#else
int32_t main(void)
#endif
{
   bool_t stop = FALSE;
   int32_t cardIndex;
   int32_t moduleCnt;
   int32_t module;
   uint32_t moduleID = 0;
   ...

   /* Main application loop handling user input and configuration */
   while (stop != TRUE) {
       ...
   }

   /* Cleanup and exit */
   naiapp_access_CloseAllOpenCards();
   return 0;
}

The main function handles the overall application flow, such as reading configuration files, querying user input for the card index, and invoking functions for specific tasks like setting up interrupts.

Key Functions

Run_DIF_Interrupts

This function verifies the selected module as a DIF module and configures the DIF interrupt channel:

void Run_DIF_Interrupts(int32_t cardIndex, int32_t module, int32_t ModuleID)
{
   int32_t MaxChannel = naibrd_DIF_GetChannelCount(ModuleID);

   if (MaxChannel == 0) {
      printf(" *** Module selection not recognized as DIF module. ***\n\n");
   } else {
      Cfg_DIF_Interrupt_Channel(cardIndex, module, ModuleID, MaxChannel);
   }
}

Cfg_DIF_Interrupt_Channel

This function guides the user through selecting the interrupt channel and setting up the interrupt:

void Cfg_DIF_Interrupt_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
{
   bool_t bQuit = FALSE;
   bool_t bContinue = TRUE;
   int32_t chan, defaultchan = 1;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   while (bContinue) {
       ...
      if (!bQuit) {
         Setup_DIF_Interrupt(cardIndex, module, chan, ModuleID);
      } else {
         bContinue = FALSE;
      }
   }
}

Setup_DIF_Interrupt

This function configures the selected channel for interrupts and sets the necessary interrupt types and vectors. It also includes setting up the Interrupt Service Routine (ISR) if RUN_ISR is defined:

void Setup_DIF_Interrupt(int32_t cardIndex, int32_t module, uint32_t channel, uint32_t ModuleID)
{
   bool_t bContinue = TRUE;
   uint8_t chanStatus;
   uint32_t groupStatus;
   int32_t retryCnt = 0;

   /* Configure DIF channel and clear status */
   ...

#if defined (RUN_ISR)
   naibrd_InstallISR(cardIndex, NAIBRD_IRQ_ID_ON_BOARD_0, (nai_isr_t)MyDIFIsr, NULL);
#endif

   /* Setup Interrupt Types and Vectors */
   naibrd_DIF_SetEdgeLevelInterrupt(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, NAI_DIF_LEVEL_INTERRUPT);
   ...
}

Handling Interrupts

If RUN_ISR is defined, an ISR MyDIFIsr is provided to handle interrupt vectors. Otherwise, the function checkForStatusChange is used to poll the status:

void MyDIFIsr(void* param, uint32_t vector)
{
   irqDIFCount++;
   receivedVector = vector;
   switch (vector) {
   case DIF_BIT_INTERRUPT_VECTOR:
      bReceivedBITInterrupt = TRUE;
      break;
   ...
   }
}

static void checkForStatusChange(int cardIndex, int module)
{
   uint32_t groupStatus;

   check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_BIT_LATCHED, &groupStatus));
   if (groupStatus != 0) {
      irqDIFCount++;
      receivedVector = DIF_BIT_INTERRUPT_VECTOR;
      bReceivedBITInterrupt = TRUE;
   }
   ...
}

This setup allows the application to either handle interrupts through an ISR or through polling, offering flexibility depending on the platform and specific requirements.

Summary

This application demonstrates how to configure and handle DIF interrupts on NAI’s embedded function modules. By interacting with the NAI libraries, it sets up the necessary configurations, processes user inputs, and handles interrupts, either through ISRs or polling based on compile-time definitions.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>

/* Common Sample Program include files */
#include "include/naiapp_interrupt.h"
#include "include/naiapp_interrupt_ether.h"
#include "include/naiapp_boardaccess_menu.h"
#include "include/naiapp_boardaccess_query.h"
#include "include/naiapp_boardaccess_access.h"
#include "include/naiapp_boardaccess_display.h"
#include "include/naiapp_boardaccess_utils.h"

/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
#include "functions/naibrd_dif.h"
#include "advanced/nai_ether_adv.h"

static const int8_t *CONFIG_FILE = (int8_t *)"default_DIF_Interrupts.txt";

/* Function prototypes */
void Run_DIF_Interrupts(int32_t cardIndex, int32_t module, int32_t ModuleID);
void Cfg_DIF_Interrupt_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel);
void Setup_DIF_Interrupt(int32_t cardIndex, int32_t module, uint32_t channel, uint32_t ModuleID);
#if !defined (RUN_ISR)
static void checkForStatusChange(int cardIndex, int module);
#endif
void MyDIFIsr(void* param,uint32_t vector);
uint32_t irqDIFCount = 0;
static uint32_t receivedVector = 0;
static bool_t bReceivedBITInterrupt = FALSE;
static bool_t bReceivedLoHiTransInterrupt = FALSE;
static bool_t bReceivedHiLoTransInterrupt = FALSE;

static const int32_t DEF_DIF_CHANNEL         = 1;

#define DIF_BIT_INTERRUPT_VECTOR                0x20
#define DIF_LO_HI_TRANS_INTERRUPT_VECTOR        0x21
#define DIF_HI_LO_TRANS_INTERRUPT_VECTOR        0x22

/**************************************************************************************************************/
/**
<summary>
The purpose of the DIF_Interrupts is to illustrate the methods to call in the naibrd library to perform configuration
and handle DIF Interrupts.

The following system configuration routines from the nai_sys_cfg.c file are called to assist with the configuration
setup for this program prior to calling the naibrd DIF routines.
 - ClearDeviceCfg
 - QuerySystemCfg
 - DisplayDeviceCfg
 - GetBoardSNModCfg
 - SaveDeviceCfg
</summary>
*/
/**************************************************************************************************************/
#if defined (__VXWORKS__)
int32_t DIF_Interrupts(void)
#else
int32_t main(void)
#endif
{
   bool_t stop = FALSE;
   int32_t cardIndex;
   int32_t moduleCnt;
   int32_t module;
   uint32_t moduleID = 0;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   if (naiapp_RunBoardMenu(CONFIG_FILE) == TRUE)
   {
      while (stop != TRUE)
      {
         /* Query the user for the card index */
         stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
         if (stop != TRUE)
         {
            check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));

            /* Query the user for the module number */
            stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
            if (stop != TRUE)
            {
               moduleID = naibrd_GetModuleID(cardIndex, module);
               if (moduleID != 0)
               {
                  Run_DIF_Interrupts(cardIndex, module, moduleID);
               }
            }
         }
         printf("\nType Q to quit or Enter key to restart application:\n");
         stop = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
      }
   }

   printf("\nType the Enter key to exit the program: ");
   naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
   naiapp_access_CloseAllOpenCards();

   return 0;
}

/**************************************************************************************************************/
/**
<summary>
Run_DIF_Interrupts prompts the user for the card, module and channel to use for the application and calls
Cfg_DIF_Interrupt_Channel if the card, module, channel is valid for as a discrete module.
</summary>
*/
/**************************************************************************************************************/
void Run_DIF_Interrupts(int32_t cardIndex, int32_t module, int32_t ModuleID)
{
   int32_t MaxChannel;

   MaxChannel = naibrd_DIF_GetChannelCount(ModuleID);

   if (MaxChannel == 0)
   {
      printf(" *** Module selection not recognized as DIF module. ***\n\n");
   }
   else
   {
      Cfg_DIF_Interrupt_Channel(cardIndex, module, ModuleID, MaxChannel);
   }
}

/**************************************************************************************************************/
/**
<summary>
Cfg_DIF_Interrupt_Channel querying the user for the channel to generate and handle DIF interrupts.
</summary>
*/
/**************************************************************************************************************/
void Cfg_DIF_Interrupt_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
{
   bool_t bQuit = FALSE;
   bool_t bContinue = TRUE;
   int32_t chan, defaultchan = 1;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   while (bContinue)
   {
      printf("    \r\n\r\n");
      printf("Channel selection \r\n");
      printf("================= \r\n");
      defaultchan = DEF_DIF_CHANNEL;
      bQuit = naiapp_query_ChannelNumber(MaxChannel, defaultchan, &chan);

      printf("\nPress Enter to set up interrupts, Type %c to quit : ", NAI_QUIT_CHAR);
      bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
      if (!bQuit)
      {
         Setup_DIF_Interrupt(cardIndex, module, chan, ModuleID);
      }
      else
         bContinue = FALSE;
   }
}

void Setup_DIF_Interrupt(int32_t cardIndex, int32_t module, uint32_t channel, uint32_t ModuleID)
{
   bool_t bContinue = TRUE;
   uint8_t chanStatus;
   uint32_t groupStatus;
   int32_t retryCnt = 0;

   /* Setup the DIF channel to Input */
   check_status(naibrd_DIF_SetOpMode(cardIndex, module, channel,  NAI_DIF_MODE_STD_INPUT_OUTPUT));
   check_status(naibrd_DIF_SetIOFormat(cardIndex, module, channel, NAI_DIF_IOFORMAT_INPUT));

   /* Clear the Status register */
   if (ModuleID == NAI_MODULE_ID_D8)
   {
      /* Clear Status Register by reading the status 2 times because the status is latched */
      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF Bit Status is set\n");

      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF Lo-Hi Transition Status is set\n");

      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF Hi-Lo Transition Status is set\n");

   }
   else if (ModuleID == NAI_MODULE_ID_DF1)
   {
      /* Clear Status Register by writing to the bit in the status register */
      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         check_status(naibrd_DIF_ClearStatus(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED));
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF BIT Status is set\n");

      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         check_status(naibrd_DIF_ClearStatus(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED));
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF Lo-Hi Transition Status is set\n");

      retryCnt = 0;
      check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
      while ((chanStatus != 0) && (retryCnt < 2))
      {
         check_status(naibrd_DIF_ClearStatus(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED));
         naibrd_Wait(1000);
         check_status(naibrd_DIF_GetStatus(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (nai_status_bit_t *)&chanStatus));
         retryCnt++;
      }
      if (chanStatus != 0)
         printf("ERROR: DIF Hi-Lo Transition Status is set\n");
   }

#if defined (RUN_ISR)
   /* Install the ISR */
    naibrd_InstallISR(cardIndex, NAIBRD_IRQ_ID_ON_BOARD_0, (nai_isr_t)MyDIFIsr, NULL);
#endif

   /* Set the Interrupt Type (Edge/Level) */
   naibrd_DIF_SetEdgeLevelInterrupt(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, NAI_DIF_LEVEL_INTERRUPT);
   naibrd_DIF_SetEdgeLevelInterrupt(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, NAI_DIF_LEVEL_INTERRUPT);
   naibrd_DIF_SetEdgeLevelInterrupt(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, NAI_DIF_LEVEL_INTERRUPT);

   /* Set the Interrupt Vectors for BIT, Lo-Hi and Hi-Lo Transition */
   naibrd_DIF_SetGroupInterruptVector(cardIndex, module, 1, NAI_DIF_STATUS_BIT_LATCHED, DIF_BIT_INTERRUPT_VECTOR);
   naibrd_DIF_SetGroupInterruptVector(cardIndex, module, 1, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, DIF_LO_HI_TRANS_INTERRUPT_VECTOR);
   naibrd_DIF_SetGroupInterruptVector(cardIndex, module, 1, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, DIF_HI_LO_TRANS_INTERRUPT_VECTOR);

   /* Set the Interrupt Steering */
   naibrd_DIF_SetGroupInterruptSteering(cardIndex, module, 1, NAI_DIF_STATUS_BIT_LATCHED, NAIBRD_INT_STEERING_ON_BOARD_0);
   naibrd_DIF_SetGroupInterruptSteering(cardIndex, module, 1, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, NAIBRD_INT_STEERING_ON_BOARD_0);
   naibrd_DIF_SetGroupInterruptSteering(cardIndex, module, 1, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, NAIBRD_INT_STEERING_ON_BOARD_0);

   /* Enable BIT, Lo-Hi and Hi-Lo Transition Interrupts */
   check_status(naibrd_DIF_SetInterruptEnable(cardIndex, module, channel, NAI_DIF_STATUS_BIT_LATCHED, TRUE));
   check_status(naibrd_DIF_SetInterruptEnable(cardIndex, module, channel, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, TRUE));
   check_status(naibrd_DIF_SetInterruptEnable(cardIndex, module, channel, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, TRUE));

   printf("\nType %c to quit : ", NAI_QUIT_CHAR);
   while (bContinue)
   {
#if !defined (RUN_ISR)
      checkForStatusChange(cardIndex, module);
#endif
      if (bReceivedBITInterrupt)
      {
         printf("DIF BIT Interrupt, Vector:0x%02X, DIF irqCount:%d\n", receivedVector, irqDIFCount);
         check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, (int32_t)1, NAI_DIF_STATUS_BIT_LATCHED, (uint32_t *)&groupStatus));
         printf("BIT Status = 0x%0X\n", groupStatus);
         check_status(naibrd_DIF_ClearGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_BIT_LATCHED, groupStatus));
         bReceivedBITInterrupt = FALSE;
      }
      if (bReceivedLoHiTransInterrupt)
      {
         printf("DIF Lo-Hi Transition Interrupt, Vector:0x%02X, DIF irqCount:%d\n", receivedVector, irqDIFCount);
         check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (uint32_t *)&groupStatus));
         printf("Lo-Hi Transition Status = 0x%0X\n", groupStatus);
         check_status(naibrd_DIF_ClearGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, groupStatus));
         bReceivedLoHiTransInterrupt = FALSE;
      }
      if (bReceivedHiLoTransInterrupt)
      {
         printf("DIF Hi-Lo Transition Interrupt, Vector:0x%02X, DIF irqCount:%d\n", receivedVector, irqDIFCount);
         check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (uint32_t *)&groupStatus));
         printf("Hi-Lo Transition Status = 0x%0X\n", groupStatus);
         check_status(naibrd_DIF_ClearGroupStatusRaw(cardIndex, module, 1, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, groupStatus));
         bReceivedHiLoTransInterrupt = FALSE;
      }

      /*bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
      if (bQuit)
      {
         bContinue = FALSE;*/
#if defined (RUN_ISR)
      /*   naibrd_UninstallISR(cardIndex); */
#endif
      /*}*/
   }
}

#if defined(WIN32) || defined(LINUX) || defined(__VXWORKS__)
#if defined (RUN_ISR)
/*****************************/
/* Interrupt Service Routine */
/*****************************/
void MyDIFIsr(void* param, uint32_t vector)
{
   irqDIFCount++;

   /* Determine what interrupt was received */
   receivedVector = vector;
   switch (vector)
   {
   case DIF_BIT_INTERRUPT_VECTOR:
      bReceivedBITInterrupt = TRUE;
      break;
   case DIF_LO_HI_TRANS_INTERRUPT_VECTOR:
      bReceivedLoHiTransInterrupt = TRUE;
      break;
   case DIF_HI_LO_TRANS_INTERRUPT_VECTOR:
      bReceivedHiLoTransInterrupt = TRUE;
      break;
   default:
      printf("Unknown Interrupt, Vector:0x%02X, DIF irqCount:%d\n", vector, irqDIFCount);
      break;
   }
}
#else
static void checkForStatusChange(int cardIndex, int module)
{
   uint32_t groupStatus;

   check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, (int32_t)1, NAI_DIF_STATUS_BIT_LATCHED, (uint32_t *)&groupStatus));
   if (groupStatus != 0)
   {
      irqDIFCount++;
      receivedVector = DIF_BIT_INTERRUPT_VECTOR;
      bReceivedBITInterrupt = TRUE;
   }

   check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, (int32_t)1, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, (uint32_t *)&groupStatus));
   if (groupStatus != 0)
   {
      irqDIFCount++;
      receivedVector = DIF_LO_HI_TRANS_INTERRUPT_VECTOR;
      bReceivedLoHiTransInterrupt = TRUE;
   }

   check_status(naibrd_DIF_GetGroupStatusRaw(cardIndex, module, (int32_t)1, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, (uint32_t *)&groupStatus));
   if (groupStatus != 0)
   {
      irqDIFCount++;
      receivedVector = DIF_HI_LO_TRANS_INTERRUPT_VECTOR;
      bReceivedHiLoTransInterrupt = TRUE;
   }
}
#endif
#endif

Help Bot

X