######################################################################## ### FILE: tbcregisters.mod ### PURPOSE: Next-Generation Thermal Block Controller definitions ### AUTHOR: Tor Slettnes ######################################################################## DEFINT TBCMap $ControlBranch$=TBC $Branch$ $Node$ ### Load global LLAC registers REGisterMap $Branch$ $Node$ $Branch$:VAR ZONeCount 0 $Branch$:VAR SENSorCount 0 $Branch$:VAR DRIVerCount 0 $Branch$:ALIas+ ZoneCount? VAR? ZoneCount $Branch$:ALIas+ SensorCount? VAR? SensorCount $Branch$:ALIas+ DriverCount? VAR? DriverCount IF $[ $(LLAC:UINT? -size=4 $Node$ 0x0008) >= 0x10000 ] INFO "Loading TBC register tables via application table" $Branch$:LOADDEF tbcregisters ApplicationTable -base=$($Branch$:AT?) ELSe INFO "Loading TBC register tables via global register table" $Branch$:REG+ -replaceExisting ZONeTable? -size=2 -type=HEX -offset=7 $Branch$:REG+ -replaceExisting SENSorTable? -size=2 -type=HEX -offset=8 $Branch$:REG+ -replaceExisting DRIVerTable? -size=2 -type=HEX -offset=9 TBCBuildTables ZONe $Branch$ $ControlBranch$ $Node$ $($Branch$:ZONeTable?) TBCBuildTables SENSor $Branch$ $ControlBranch$ $Node$ $($Branch$:SENSorTable?) TBCBuildTables DRIVer $Branch$ $ControlBranch$ $Node$ $($Branch$:DRIVerTable?) TBCNVRAMTable $Branch$ DEFINT TBCBuildTables $Type$ $RegBranch$ $ControlBranch$ $Node$ $TableAddress$ $RegBranch$:REG+ $Type$List? -type=UINT -size=2 -node=$Node$ -base=$TableAddress$ LVAR Count $($RegBranch$:$Type$List?) INFO "Adding ${Count} $Type$ tables in $ControlBranch$ branch, per index register at $Node$/$TableAddress$" ### For each register up to this count, define an address register REPeat -counter=n -start=1 ${Count} TBCAddTable $Type$ $ControlBranch$ $Node$ $($RegBranch$:$Type$List? -offset=${n}) $RegBranch$:REG- $Type$List? DEFINT TBCAddTable $Type$ $ControlBranch$ $Node$ $BaseRegister$ $ControlBranch$:ADDValue $Type$Count 1 LVAR Prefix $Type$$($ControlBranch$:VAR? $Type$Count) $ControlBranch$:BRANch+ -type=LLACBranch ${Prefix} $ControlBranch$:${Prefix}:BASe= $Node$ $BaseRegister$ $ControlBranch$:${Prefix}:LOADDEF tbcregisters $Type$Table DEFINT TBCNVRAMTable $Branch$ $Branch$:ALI+ -replaceExisting CyclicRedundancyCheck? NVRAM? 0x0003 UINT $Branch$:ALI+ -replaceExisting ChecKSum? NVRAM? 0x0004 UINT $Branch$:ALI+ -replaceExisting SerialNumber NVRAM 0x8012 UINT $Branch$:ALI+ -replaceExisting SerialNumber? NVRAM? 0x8012 UINT $Branch$:ALI+ -replaceExisting CoverIdleSetPoint NVRAM 0x0007 REAL $Branch$:ALI+ -replaceExisting CoverIdleSetPoint? NVRAM? 0x0007 REAL $Branch$:ALI+ -replaceExisting BlockID NVRAM 0x8001 UINT $Branch$:ALI+ -replaceExisting BlockID? NVRAM? 0x8001 UINT $Branch$:ALI+ -replaceExisting LifeCycleCount NVRAM 0x8014 UINT $Branch$:ALI+ -replaceExisting LifeCycleCount? NVRAM? 0x8014 UINT $Branch$:ALI+ -replaceExisting LifeDegreesClimbed NVRAM 0x8015 UINT $Branch$:ALI+ -replaceExisting LifeDegreesClimbed? NVRAM? 0x8015 UINT