www.pudn.com > H265+_C64X_2008.8.rar > evmdm642_pci.c


/* 
 *  Copyright 2003 by Spectrum Digital Incorporated. 
 *  All rights reserved. Property of Spectrum Digital Incorporated. 
 */ 
  
/* 
 *  ======== evmdm642_pci.c ======== 
 *  PCI module for the EVMDM642 
 */ 
  
#include  
#include  
 
#include "evmdm642.h" 
#include "evmdm642_pci.h" 
 
Int16 EVMDM642_PCI_config(Uint16 *config) 
{ 
    Uint16 i, checksum; 
     
    /* If EEPROM not properly connected, return fail code */ 
    if (PCI_eepromTest() == 0) 
        return 1; 
 
    /* Write all registers based on config structure */ 
    for (i = 0; i < EVMDM642_PCI_CONFIGREGS; i++) 
        PCI_eepromWrite(i, config[i]); 
         
    /* Compute checksum */ 
    checksum = 0xAAAA; 
    for (i = 0; i < EVMDM642_PCI_CONFIGREGS; i++) 
        checksum ^= config[i]; 
     
    /* Write checksum */ 
    PCI_eepromWrite(EVMDM642_PCI_CONFIGREGS, checksum); 
         
    return 0; 
}