MityDSP Documentation Index

MityDSP::tcDspConfig Class Reference

This is a singleton class. More...

#include <core/DspConfig.h>

List of all members.

Public Types

enum  teConfigItem {
  eeIDD = 0, eeBoardRevision = 1, eeMACAddress = 2, eeSerialNumber = 3,
  eeAppDataBlock = 4, eeAppDataSize = 5, eeDefaultApp = 6, eeNumConfigItems = 7
}

Public Member Functions

bool IsConfigured (void)
 Returns whether Configuration Data was successfully loaded from FLASH.
bool IsConfigured (teConfigItem aeItem)
 Use this method to determine if a specific configuration item was successfully loaded from FLASH.
unsigned short GetIDDRevision (void)
 Gets the interface version of the MityDSP board level configuration block.
tsBoardTypeRev GetBoardRevision (void)
 Gets the board revision of the MityDSP.
tsBootVer GetBootVersion (void)
 Gets the version of the MityDSP bootloader.
tsBootDate GetBootDate (void)
 Gets the build date of the MityDSP bootloader.
unsigned int GetSerialNumber (void)
 Get the serial number of the MityDSP board.
void GetMACAddress (unsigned char *apMACAddr)
 Copies the MityDSP assigned MAC address to the provided pointer.
unsigned int GetAppDataOffset (int anApp=-1)
 Get the FLASH offset (in bytes) for the application data sector.
unsigned int GetAppDataSize (int anApp=-1)
 Get the number of FLASH bytes assigned Application Data Sector.
unsigned int GetAppOffset (int anApp=-1)
 Get the FLASH offset (in bytes) for the application Code sector.
unsigned int GetAppSize (int anApp=-1)
 Get the number of FLASH bytes assigned Application Code Sector.
int GetDefaultApp (void)
 Get the default application loaded from FLASH.
const tsConfigSect * GetConfigBlock (void)
 Get a pointer to a copy of the Configuration Block.
const char * GetBoardTypeText (tsBoardTypeRev asRev)
 Get a pointer to human readable text description of board.
const char * GetBoardRevText (tsBoardTypeRev asRev)
 Get a pointer to human readable text description of board revision.
unsigned int GetFpgaOffset (int anApp=-1)
 Get the FLASH offset (in bytes) for the application FPGA data sector.
unsigned int GetFpgaSize (int anApp=-1)
 Get the number of FLASH bytes assigned Application FPGA Data Sector.
unsigned int GetCLUBAppOffset (void)
 Get the FLASH offset (in bytes) for the application FPGA data sector.
unsigned int GetCLUBAppSize (void)
 Get the number of FLASH bytes assigned to the Bootloader (CLUB) Data Sector.
unsigned int GetCLUBFpgaOffset (void)
 Get the FLASH offset (in bytes) for the Bootloader (CLUB) FPGA data sector.
unsigned int GetCLUBFpgaSize (void)
 Get the number of FLASH bytes assigned to the Bootloader (CLUB) FPGA Data Sector.
unsigned int GetBootstrapOffset (void)
 Get the FLASH offset (in bytes) for the Bootstrapper data sector.
unsigned int GetBootstrapSize (void)
 Get the number of FLASH bytes assigned to the Bootstrapper Data Sector.

Static Public Member Functions

static tcDspConfigGetInstance (tcDspFlash *apFlash)
 Gets the instance of the tcDspConfig Singleton.

Protected Member Functions

 tcDspConfig (tcDspFlash *apFlash)
 tcDspConfig Constructor with default initializers.
 ~tcDspConfig (void)
 Destructor.
void ReadFromFlash (void)
 Extracts the FLASH configuration data to local member data for later access.

Protected Attributes

tcDspFlashmpFlash
 flash memory controller object
tsConfigSect * mpConfigSect
 local copy of the config block
bool mbReadOK
 indicates flash was read successfully
bool mbConfigValid
 indicates flash area deemed valid
bool * mpConfigAvail
 array of eeNumConfigItems of OK or NOT OK
unsigned short mnIDDRevision
 IDD Revision 0xXXYY, XX=major, YY=minor.
tsBoardTypeRev mnBoardRevision
 Board revision.
tsBootVer mnBootVer
 Bootloader version.
tsBootDate mnBootDate
 Bootloader date.
unsigned char maMACAddr [6]
 MAC Address.
unsigned int mnSerialNumber
 Serial Number.
int mnDefaultApp
 Default application ID loaded.
unsigned int mnAppOffset [NUM_APPLICATIONS]
 Starting FLASH offset for application code.
unsigned int mnAppSize [NUM_APPLICATIONS]
 Maximum FLASH size for application code.
unsigned int mnAppDataOffset [NUM_APPLICATIONS]
 Starting FLASH offset for application data.
unsigned int mnAppDataSize [NUM_APPLICATIONS]
 Maximum FLASH size for application data.
unsigned int mnFpgaDataOffset [NUM_APPLICATIONS]
 Starting FLASH offset for application FPGA data.
unsigned int mnFpgaDataSize [NUM_APPLICATIONS]
 Maximum FLASH size for application FPGA data.
unsigned int mnBootFpgaOffset
 Starting FLASH offset for CLUB FPGA data.
unsigned int mnBootFpgaSize
 Maximum FLASH size for CLUB FPGA data.
unsigned int mnCLUBAppOffset
 Starting FLASH offset for CLUB Application data.
unsigned int mnCLUBAppSize
 Maximum FLASH size for CLUB Application data.

Static Protected Attributes

static tcDspConfiggpDspConfig = NULL
 The singleton pointer.
static const unsigned int DEF_APP_SW_OFFSET = 0x100000
 default application SW offset

Detailed Description

This is a singleton class.

This class provides for reading the MityDSP board level common configuration data, including (but not limited to) board serial number, assigned MAC address, and board revision number.

A reference pointer to this class is accessable through the GetInstance() method. Applications may not directly construct or destroy this class as it is a singleton.

Note:
This class is not intended (nor does it support) application specific information. Application non-volatile data must be maintained in a separate flash sector than the MityDSP board level configuration data. See the MityDSP Design Guidelines program memo for further details.
See also:
tcDspConfig Page

Member Enumeration Documentation

Enumerator:
eeIDD 
eeBoardRevision 
eeMACAddress 
eeSerialNumber 
eeAppDataBlock 
eeAppDataSize 
eeDefaultApp 
eeNumConfigItems 

Constructor & Destructor Documentation

tcDspConfig::tcDspConfig ( tcDspFlash apFlash  )  [protected]

tcDspConfig Constructor with default initializers.

tcDspConfig::~tcDspConfig ( void   )  [protected]

Destructor.


Member Function Documentation

tcDspConfig * tcDspConfig::GetInstance ( tcDspFlash apFlash  )  [static]

Gets the instance of the tcDspConfig Singleton.

Returns:
Pointer of the initialized tcDspConfig Item
bool tcDspConfig::IsConfigured ( void   ) 

Returns whether Configuration Data was successfully loaded from FLASH.

Returns:
true if flash read was OK and valid config loaded
bool tcDspConfig::IsConfigured ( teConfigItem  aeItem  ) 

Use this method to determine if a specific configuration item was successfully loaded from FLASH.

This method is useful if and when the IDD of the configuration data is updated, but a legacy MityDSP is in use.

Note:
This method is added for future revision to the Configuration Area.
Returns:
true if item was read from FLASH
unsigned short tcDspConfig::GetIDDRevision ( void   ) 

Gets the interface version of the MityDSP board level configuration block.

Returns:
IDD interface version 0xXXXXYYYY where XXXX / YYYY are major/minor version numbers.
tsBoardTypeRev tcDspConfig::GetBoardRevision ( void   ) 

Gets the board revision of the MityDSP.

Returns:
The revision in a tsBoardTypeRev record
tsBootVer tcDspConfig::GetBootVersion ( void   ) 

Gets the version of the MityDSP bootloader.

Returns:
The version in a tsBootVer record.
tsBootDate tcDspConfig::GetBootDate ( void   ) 

Gets the build date of the MityDSP bootloader.

Returns:
The date in a tsBootDate record.
unsigned int tcDspConfig::GetSerialNumber ( void   ) 

Get the serial number of the MityDSP board.

Returns:
The serial number
void tcDspConfig::GetMACAddress ( unsigned char *  apMACAddr  ) 

Copies the MityDSP assigned MAC address to the provided pointer.

Parameters:
[out] apMACAddr pointer to 6 byte array for MAC Address
Returns:
None.
unsigned int tcDspConfig::GetAppDataOffset ( int  anApp = -1  ) 

Get the FLASH offset (in bytes) for the application data sector.

Parameters:
[in] anApp Application ID (0-7) of the block offset to retrieve (default application if none provided).
Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetAppDataSize ( int  anApp = -1  ) 

Get the number of FLASH bytes assigned Application Data Sector.

Parameters:
[in] anApp Application ID (0-7) of the block size to retrieve (default application if none provided).
Returns:
The number of bytes assocated with the area
unsigned int tcDspConfig::GetAppOffset ( int  anApp = -1  ) 

Get the FLASH offset (in bytes) for the application Code sector.

Parameters:
[in] anApp Application ID (0-7) of the block offset to retrieve (default application if none provided).
Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetAppSize ( int  anApp = -1  ) 

Get the number of FLASH bytes assigned Application Code Sector.

Parameters:
[in] anApp Application ID (0-7) of the block size to retrieve (default application if none provided).
Returns:
The number of bytes assocated with the area
int tcDspConfig::GetDefaultApp ( void   ) 

Get the default application loaded from FLASH.

Returns:
Application ID (0-7)
const tsConfigSect * tcDspConfig::GetConfigBlock ( void   ) 

Get a pointer to a copy of the Configuration Block.

Returns:
Constant pointer, or NULL if not yet read.
const char * tcDspConfig::GetBoardTypeText ( tsBoardTypeRev  asRev  ) 

Get a pointer to human readable text description of board.

E.G. "MityDSP-XC3S200" (Type 1 - MityDSP with XC3S200 sized FPGA)

Returns:
Constant pointer, "UNKNOWN" if device ID is unknown.
const char * tcDspConfig::GetBoardRevText ( tsBoardTypeRev  asRev  ) 

Get a pointer to human readable text description of board revision.

Returns:
Constant pointer, or NULL if not yet read.
unsigned int tcDspConfig::GetFpgaOffset ( int  anApp = -1  ) 

Get the FLASH offset (in bytes) for the application FPGA data sector.

Parameters:
[in] anApp Application ID (0-7) of the block offset to retrieve (default application if none provided).
Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetFpgaSize ( int  anApp = -1  ) 

Get the number of FLASH bytes assigned Application FPGA Data Sector.

Parameters:
[in] anApp Application ID (0-7) of the block size to retrieve (default application if none provided).
Returns:
The number of bytes assocated with the area
unsigned int tcDspConfig::GetCLUBAppOffset ( void   ) 

Get the FLASH offset (in bytes) for the application FPGA data sector.

Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetCLUBAppSize ( void   ) 

Get the number of FLASH bytes assigned to the Bootloader (CLUB) Data Sector.

Returns:
The number of bytes assocated with the area
unsigned int tcDspConfig::GetCLUBFpgaOffset ( void   ) 

Get the FLASH offset (in bytes) for the Bootloader (CLUB) FPGA data sector.

Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetCLUBFpgaSize ( void   ) 

Get the number of FLASH bytes assigned to the Bootloader (CLUB) FPGA Data Sector.

Returns:
The number of bytes assocated with the area
unsigned int tcDspConfig::GetBootstrapOffset ( void   ) 

Get the FLASH offset (in bytes) for the Bootstrapper data sector.

Returns:
The byte offset from the base of flash memory
unsigned int tcDspConfig::GetBootstrapSize ( void   ) 

Get the number of FLASH bytes assigned to the Bootstrapper Data Sector.

Returns:
The number of bytes assocated with the area
void tcDspConfig::ReadFromFlash ( void   )  [protected]

Extracts the FLASH configuration data to local member data for later access.

Returns:
None.

Member Data Documentation

tcDspConfig * tcDspConfig::gpDspConfig = NULL [static, protected]

The singleton pointer.

const unsigned int MityDSP::tcDspConfig::DEF_APP_SW_OFFSET = 0x100000 [static, protected]

default application SW offset

flash memory controller object

tsConfigSect* MityDSP::tcDspConfig::mpConfigSect [protected]

local copy of the config block

indicates flash was read successfully

indicates flash area deemed valid

array of eeNumConfigItems of OK or NOT OK

unsigned short MityDSP::tcDspConfig::mnIDDRevision [protected]

IDD Revision 0xXXYY, XX=major, YY=minor.

tsBoardTypeRev MityDSP::tcDspConfig::mnBoardRevision [protected]

Board revision.

tsBootVer MityDSP::tcDspConfig::mnBootVer [protected]

Bootloader version.

tsBootDate MityDSP::tcDspConfig::mnBootDate [protected]

Bootloader date.

unsigned char MityDSP::tcDspConfig::maMACAddr[6] [protected]

MAC Address.

unsigned int MityDSP::tcDspConfig::mnSerialNumber [protected]

Serial Number.

Default application ID loaded.

unsigned int MityDSP::tcDspConfig::mnAppOffset[NUM_APPLICATIONS] [protected]

Starting FLASH offset for application code.

unsigned int MityDSP::tcDspConfig::mnAppSize[NUM_APPLICATIONS] [protected]

Maximum FLASH size for application code.

unsigned int MityDSP::tcDspConfig::mnAppDataOffset[NUM_APPLICATIONS] [protected]

Starting FLASH offset for application data.

unsigned int MityDSP::tcDspConfig::mnAppDataSize[NUM_APPLICATIONS] [protected]

Maximum FLASH size for application data.

unsigned int MityDSP::tcDspConfig::mnFpgaDataOffset[NUM_APPLICATIONS] [protected]

Starting FLASH offset for application FPGA data.

unsigned int MityDSP::tcDspConfig::mnFpgaDataSize[NUM_APPLICATIONS] [protected]

Maximum FLASH size for application FPGA data.

unsigned int MityDSP::tcDspConfig::mnBootFpgaOffset [protected]

Starting FLASH offset for CLUB FPGA data.

unsigned int MityDSP::tcDspConfig::mnBootFpgaSize [protected]

Maximum FLASH size for CLUB FPGA data.

unsigned int MityDSP::tcDspConfig::mnCLUBAppOffset [protected]

Starting FLASH offset for CLUB Application data.

unsigned int MityDSP::tcDspConfig::mnCLUBAppSize [protected]

Maximum FLASH size for CLUB Application data.


  
Generated on Fri Sep 23 16:33:48 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.