/* Example of get jumpt status.

   Author: Winson Chen
*/

/* File level history (record changes for this file here.)

   This example created for get card id.

   v 0.0.0 21 Mar 2025 by Winson Chen
     create */


#include "pcidio.h"

int main()
{
  int fd;
  char *dev_file;
  WORD status;

  dev_file = "/dev/ixpci1";

  /* open device file */
  fd = PCIDA_Open(dev_file);

  if (fd < 0){
    printf("Can't open device\n");
    return FAILURE;
  }

  /* init device */
  if (PCIDA_DriverInit(fd)) return FAILURE;

  PCIFC16_GetJumpStatus(fd, &status);
  printf("Jumper status is %d\n\n",status);

  printf("                DIO Port Configuration\n");
  printf("Jumper S0 S1 S2 JP1-S0 Port A Port B\n0x0    0  x  x  SW     x      x\n0x4    1  0  0  HW     DI     DI\n0x5    1  0  1  HW     DI     DO\n0x6    1  1  0  HW     DO     DI\n0x7    1  1  1  HW     DO     DO\n");

  /* close device */
  PCIDA_Close(fd);
  puts("End of program");
  return SUCCESS;
}

