/***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /***** *****/ /***** D H C - 8 S e r i e s 4 0 0 *****/ /***** *****/ /***** F U E L Q U A N T I T Y M E A S U R E M E N T S Y S T E M *****/ /***** *****/ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /* */ /* Program Name : DHC-8 Fuel Quantity Measurement System */ /* Source File Name : nvmswitc.h */ /* CPC : Non-Volatile Memory */ /* Engineer : Linda Jahnke / Rosanne Parnell */ /* Criticality Level : Level C */ /* Contents : switch file */ /* Description : This switch file contains all the CPCI-specific */ /* NVM literals and structures. */ /* */ /* */ /* Contents of this document are propriety information, property of: */ /* PARKER HANNIFIN CORPORATION */ /* GULL ELECTRONIC SYSTEMS DIVISION */ /* SMITHTOWN, NEW YORK 11787 */ /* Any attempt to copy or use the contents of this document in any manner */ /* whatsoever without express written consent of the owner is prohibited. */ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ /* Revision History */ /***************************************************************************/ /* */ /* Date Rev Engineer Description */ /* ------ --- -------- ------------------------------------------------ */ /* */ /***************************************************************************/ /**********************************************************************/ /**********************************************************************/ /* Directions for updating these data structures for use in your CPCI */ /**********************************************************************/ /**********************************************************************/ /***********************************************************************************************/ /* Setting up functional groups */ /* */ /* If required, NOVRAM can be broken up into functional groups where each */ /* group contains specific data ( ex. fault data or preselect data). Each */ /* group needs to be allocated a place in the NOVRAM this is done as follows : */ /* */ /* */ /* For each group change NVM_GROUP_DEFINITIONS struct table as follows : */ /* */ /* give */ /* number of record (should include minimum required number plus some for spare */ /* size of records in byte (data + 1 byte for status + 1 byte for checksum) */ /* the location of the start of the group */ /* then number of locations that need to fail prior to reporting a NOVRAM failure */ /* */ /* The location of the start of the group is the starting byte location */ /* which can be any where from 0 - the size of the NOVRAM (2k). The */ /* first group should start at location 0 */ /* the next groups should start at the location calculated by the following */ /* */ /* (record size * (num of records+num of spare) + starting location of the previous group */ /* */ /* */ /* */ /* The size of the arrays in the following structures should also be */ /* updated as stated where they are declared : */ /* */ /* nvm_eeprom_read_buffer */ /* nvm_eeprom_write_buffer */ /* NVM_OUT_T */ /***********************************************************************************************/ /*********************************************************************/ /* The following constants should also be considred when customizing */ /* this CPC to be incorporated into a CPCI */ /*********************************************************************/ #define MAX_NUM_OF_GROUPS 2 /* number of NOVRAM functional groups */ #define NVM_NOVRAM_SIZE 2048 /* size of NOVRAM in bytes */ #define MAX_BYTES_TO_ERASE 16 /* max number of bytes to erase at one time */ /* this is a timing issue - it can take up to */ /* 10ms to write 16 bytes of data */ typedef struct { uchar num_of_records; uchar record_size_in_bytes; /* rec size including checksum */ uint start_location; uchar max_failures; } NVM_GROUP_DEFINITION_T; NVM_GROUP_DEFINITION_T code NVM_GROUP_DEFINITIONS[MAX_NUM_OF_GROUPS] = { /*** number of records size of records location max_failures ***/ 20, 8, 0, 11, 20, 8, 160, 11}; #define NOVRAM_END 320 /* the last groups start address + */ /* (record size * number of records) */ /* from NVM_GROUP_DEFINITIONS */ typedef struct { uchar rec_offset; /* the record position within NOVRAM */ uchar status; /* status of the data being - good record */ /* no next record or novram record failure */ } NVM_REC_STATUS_T; typedef struct { NVM_REC_STATUS_T rec_status; uchar record_data[6]; /* size should be 2 less than the */ /* maximum record size in */ /* NVM_GROUP_DEFINITIONS */ } NVM_OUT_T; struct { uchar write_cntr_byte; uchar offset_addr; uchar read_cntr_byte; uchar record[8]; /* should be the maximum record size in */ /* bytes in NVM_GROUP_DEFINTIONS */ } nvm_eeprom_read_buffer; struct { uchar write_cntr_byte; uchar offset_addr; uchar record[8]; // should be the maximum record size in // bytes in NVM_GROUP_DEFINTIONS } nvm_eeprom_write_buffer;