This is a singleton class. More...
#include <core/DspConfig.h>
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 tcDspConfig * | GetInstance (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 | |
tcDspFlash * | mpFlash |
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 tcDspConfig * | gpDspConfig = NULL |
The singleton pointer. | |
static const unsigned int | DEF_APP_SW_OFFSET = 0x100000 |
default application SW offset |
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.
tcDspConfig::tcDspConfig | ( | tcDspFlash * | apFlash | ) | [protected] |
tcDspConfig Constructor with default initializers.
tcDspConfig::~tcDspConfig | ( | void | ) | [protected] |
Destructor.
tcDspConfig * tcDspConfig::GetInstance | ( | tcDspFlash * | apFlash | ) | [static] |
Gets the instance of the tcDspConfig Singleton.
bool tcDspConfig::IsConfigured | ( | void | ) |
Returns whether Configuration Data was successfully loaded from FLASH.
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.
unsigned short tcDspConfig::GetIDDRevision | ( | void | ) |
Gets the interface version of the MityDSP board level configuration block.
tsBoardTypeRev tcDspConfig::GetBoardRevision | ( | void | ) |
Gets the board revision of the MityDSP.
tsBootVer tcDspConfig::GetBootVersion | ( | void | ) |
Gets the version of the MityDSP bootloader.
tsBootDate tcDspConfig::GetBootDate | ( | void | ) |
Gets the build date of the MityDSP bootloader.
unsigned int tcDspConfig::GetSerialNumber | ( | void | ) |
Get the serial number of the MityDSP board.
void tcDspConfig::GetMACAddress | ( | unsigned char * | apMACAddr | ) |
Copies the MityDSP assigned MAC address to the provided pointer.
[out] | apMACAddr | pointer to 6 byte array for MAC Address |
unsigned int tcDspConfig::GetAppDataOffset | ( | int | anApp = -1 |
) |
Get the FLASH offset (in bytes) for the application data sector.
[in] | anApp | Application ID (0-7) of the block offset to retrieve (default application if none provided). |
unsigned int tcDspConfig::GetAppDataSize | ( | int | anApp = -1 |
) |
Get the number of FLASH bytes assigned Application Data Sector.
[in] | anApp | Application ID (0-7) of the block size to retrieve (default application if none provided). |
unsigned int tcDspConfig::GetAppOffset | ( | int | anApp = -1 |
) |
Get the FLASH offset (in bytes) for the application Code sector.
[in] | anApp | Application ID (0-7) of the block offset to retrieve (default application if none provided). |
unsigned int tcDspConfig::GetAppSize | ( | int | anApp = -1 |
) |
Get the number of FLASH bytes assigned Application Code Sector.
[in] | anApp | Application ID (0-7) of the block size to retrieve (default application if none provided). |
int tcDspConfig::GetDefaultApp | ( | void | ) |
Get the default application loaded from FLASH.
const tsConfigSect * tcDspConfig::GetConfigBlock | ( | void | ) |
Get a pointer to a copy of the Configuration Block.
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)
const char * tcDspConfig::GetBoardRevText | ( | tsBoardTypeRev | asRev | ) |
Get a pointer to human readable text description of board revision.
unsigned int tcDspConfig::GetFpgaOffset | ( | int | anApp = -1 |
) |
Get the FLASH offset (in bytes) for the application FPGA data sector.
[in] | anApp | Application ID (0-7) of the block offset to retrieve (default application if none provided). |
unsigned int tcDspConfig::GetFpgaSize | ( | int | anApp = -1 |
) |
Get the number of FLASH bytes assigned Application FPGA Data Sector.
[in] | anApp | Application ID (0-7) of the block size to retrieve (default application if none provided). |
unsigned int tcDspConfig::GetCLUBAppOffset | ( | void | ) |
Get the FLASH offset (in bytes) for the application FPGA data sector.
unsigned int tcDspConfig::GetCLUBAppSize | ( | void | ) |
Get the number of FLASH bytes assigned to the Bootloader (CLUB) Data Sector.
unsigned int tcDspConfig::GetCLUBFpgaOffset | ( | void | ) |
Get the FLASH offset (in bytes) for the Bootloader (CLUB) FPGA data sector.
unsigned int tcDspConfig::GetCLUBFpgaSize | ( | void | ) |
Get the number of FLASH bytes assigned to the Bootloader (CLUB) FPGA Data Sector.
unsigned int tcDspConfig::GetBootstrapOffset | ( | void | ) |
Get the FLASH offset (in bytes) for the Bootstrapper data sector.
unsigned int tcDspConfig::GetBootstrapSize | ( | void | ) |
Get the number of FLASH bytes assigned to the Bootstrapper Data Sector.
void tcDspConfig::ReadFromFlash | ( | void | ) | [protected] |
Extracts the FLASH configuration data to local member data for later access.
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
tcDspFlash* MityDSP::tcDspConfig::mpFlash [protected] |
flash memory controller object
tsConfigSect* MityDSP::tcDspConfig::mpConfigSect [protected] |
local copy of the config block
bool MityDSP::tcDspConfig::mbReadOK [protected] |
indicates flash was read successfully
bool MityDSP::tcDspConfig::mbConfigValid [protected] |
indicates flash area deemed valid
bool* MityDSP::tcDspConfig::mpConfigAvail [protected] |
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.
int MityDSP::tcDspConfig::mnDefaultApp [protected] |
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.