INOS
|
The main class handling a COP bus, local or remote (GinLink passive). More...
#include <cinoscopmaster.h>
Public Types | |
enum | EOptionalFeatures { eNone = 0 , eEepromRead = (1<<0) , eEepromWrite = (1<<1) , eSpiRead = (1<<2) , eSpiWrite = (1<<3) , e8kLayout = (1<<4) , eActive = (1<<5) , eParasite = (1<<6) , eChief = (1<<7) , eAll = (eEepromRead | eEepromWrite | eSpiRead | eSpiWrite) } |
enum | { eIrqMax = 8 , eIrqMain = 1 , eIrqCore1 = 2 , eIrqMotor = 2 , eIrqOverrun = 8 } |
Public Member Functions | |
void | Reset () |
reset bus | |
void | BusScan (XMLNode aConfigNode) |
scan bus | |
void | BusStartup () |
call startup actions of all modules | |
void | SeqStart (uint32 auCycleTimeNs, uint32 auSyncPage=0, bool abSoftSync=false) |
start sequencer | |
void | SeqStop () |
stop sequencer | |
void | SeqWatchdog (uint32 auBusControl, int16 aiCycleAdjust) |
handle watchdog (only on active master) | |
void | ToggleWatchdog () |
toggle watchdog (only on active master) | |
void | SeqClear () |
clear sequencer table | |
void | SeqWrite (uint32 *apTable, bool abForceIrq=false, SINOSCOPSubroutine *apSubChain=0) |
write sequencer table | |
void | SeqEnableIrq () |
enable irq | |
uint32 | SeqGetTime (uint32 uSubCycle=0) |
get table length [ns] | |
CINOSCOPModule * | GetFirst () |
get first module | |
CINOSCOPModule * | GetNext (CINOSCOPModule *apModule) |
get next module | |
CINOSCOPModule * | GetModule (uint32 auAddress) |
Get module by address. | |
CINOSCOPModule * | GetModule (const char *apName) |
Get module by name. | |
bool | HasModuleType (const char *apType) |
Return true if copbus has a module of the given type. | |
void * | GetDprAddress (uint16 auDprOffset) |
get dpr address | |
CINCOCOPDevice * | GetDevice () |
get pointer to cop device | |
bool | ReadModuleSpiData (uint32 auNumber, uint32 auCount, uint8 *apBuffer, uint32 auBufferSize) |
Read some data from a module's spi flash (fixed memory address). | |
bool | WriteModuleSpiData (uint32 auNumber, uint32 auCount, uint8 *apBuffer) |
Write some data into a module's spi flash (fixed memory address). | |
CINOSCOPMaster (CINCOCOPDevice *apDevice, bool abCopPas=false) | |
Constructor. | |
virtual | ~CINOSCOPMaster () |
Destructor. | |
uint32 | GetError () |
Get errors of cop bus master. | |
bool | ReadModuleEeprom (uint32 auNumber, SINOSCOPModuleEeprom &aEeprom, uint32 auSize) |
Complete sequence to read a module's eeprom. | |
bool | WriteModuleEeprom (uint32 auNumber, SINOSCOPModuleEeprom &aEeprom, uint32 auSize) |
Write a module's eeprom. | |
uint32 * | GetSeqTable () |
Get pointer to sequence backup table. | |
uint32 | GetSeqTableSize () |
Get size of sequence table in uint32 units. | |
bool | CheckRangeCondition (const char *apModule, CINOSBusPortHandlerRangeCondition *apCond) |
Check if the condition of a range is met. | |
void | CreateModules (XMLNode aConfigNode) |
Create modules with given xml config file. | |
CINOSCOPModule * | CreateModule (XMLNode xCard, const char *apModName, uint32 auAddress, uint32 auAppRev, uint32 auProductCode) |
Create a module with the given information. | |
bool | IsModuleOnline () |
Return online state of device's bus module. | |
void | SetOptionalFeatures (uint32 auFeatures) |
void | AddOptionalFeatures (uint32 auFeature) |
bool | IsOptionalFeatureEnabled (EOptionalFeatures aeFeature) const |
bool | IsParasite () const |
bool | IsChief () const |
uint32 | GetCycleTimer () const |
Friends | |
class | CGINModuleActive |
class | CINOSMcTargetFieldbusMasterCopBus |
The main class handling a COP bus, local or remote (GinLink passive).
Some features are not implemented by specific COP masters. e.g. the hammer board does not support EEPROM access or SPI read access. This enum lists all optional features. By default, a CINOSCOPMaster supports all features. Use SetOptionalFeatures to limit them.
|
inline |
Add an optional feature.
auFeature | optional feature to be added |
bool CINOSCOPMaster::CheckRangeCondition | ( | const char * | apModule, |
CINOSBusPortHandlerRangeCondition * | apCond | ||
) |
Check if the condition of a range is met.
apModule | Name of sub module where the range is used. |
apCond | Condition to check. |
CINOSCOPModule * CINOSCOPMaster::CreateModule | ( | XMLNode | xCard, |
const char * | apModName, | ||
uint32 | auAddress, | ||
uint32 | auAppRev, | ||
uint32 | auProductCode | ||
) |
Create a module with the given information.
xCard | Xml config for the module. |
apModName | Module name to use e.g. user configured. |
auAddress | Address of module on cop bus. |
auAppRev | Gal revision with modules type. |
auProductCode | Code number of module. |
Create modules with given xml config file.
aConfigNode | Node config that holds config for sub modules. |
uint32 CINOSCOPMaster::GetCycleTimer | ( | ) | const |
|
inline |
Get errors of cop bus master.
CINOSCOPModule * CINOSCOPMaster::GetModule | ( | const char * | apName | ) |
Get module by name.
apName | Name of desired module. |
|
inline |
Get pointer to sequence backup table.
|
inline |
Get size of sequence table in uint32 units.
Return true if copbus has a module of the given type.
apType | Requested type name. |
|
inline |
bool CINOSCOPMaster::IsModuleOnline | ( | ) |
Return online state of device's bus module.
|
inline |
|
inline |
bool CINOSCOPMaster::ReadModuleSpiData | ( | uint32 | auNumber, |
uint32 | auCount, | ||
uint8 * | apBuffer, | ||
uint32 | auBufferSize | ||
) |
Read some data from a module's spi flash (fixed memory address).
auNumber | Address of cop module. |
auCount | Number of bytes to read. |
apBuffer | Buffer to take received data. |
auBufferSize | Size of buffer. |
|
inline |
Set the list of optionally supported features. Just "or" the enums in EOptionalFeatures. Note: By default, a COP master supports all optional features. Therefore, this function is only used to "limit" the supported features.
auFeatures | Ored list of EOptionalFeatures |
bool CINOSCOPMaster::WriteModuleEeprom | ( | uint32 | auNumber, |
SINOSCOPModuleEeprom & | aEeprom, | ||
uint32 | auSize | ||
) |
Write a module's eeprom.
auNumber | Address of module. |
aEeprom | Eeprom data to write. |
bool CINOSCOPMaster::WriteModuleSpiData | ( | uint32 | auNumber, |
uint32 | auCount, | ||
uint8 * | apBuffer | ||
) |
Write some data into a module's spi flash (fixed memory address).
auNumber | Address of cop module. |
auCount | Number of bytes to write. |
apBuffer | Buffer with data to write. |