Initial check in
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
unit mr.trinity.utils;
|
||||
|
||||
interface
|
||||
uses
|
||||
mr.trinity.consts,
|
||||
mr.trinity.types;
|
||||
|
||||
function DecodeCapabilities( caps: Int64 ): TCapabilities;
|
||||
function EncodeCapabilities( caps: TCapabilities): Int64;
|
||||
|
||||
implementation
|
||||
|
||||
// ================================================================================================
|
||||
// EncodeCapabilities
|
||||
// ================================================================================================
|
||||
function EncodeCapabilities( caps: TCapabilities): Int64;
|
||||
begin
|
||||
result := 0;
|
||||
|
||||
if capJTAG in caps then result := result or bmCap0_JTG;
|
||||
end;
|
||||
|
||||
// ================================================================================================
|
||||
// DecodeCapabilities
|
||||
// ================================================================================================
|
||||
function DecodeCapabilities( caps: Int64): TCapabilities;
|
||||
begin
|
||||
result := [];
|
||||
|
||||
if( caps and bmCap0_I2C ) <> 0 then Include( result, capIIC );
|
||||
if( caps and bmCap0_SER ) <> 0 then Include( result, capSER );
|
||||
if( caps and bmCap0_EPR ) <> 0 then Include( result, capEEPROM );
|
||||
if( caps and bmCap0_RAM ) <> 0 then Include( result, capRAM );
|
||||
if( caps and bmCap0_JTG ) <> 0 then Include( result, capJTAG );
|
||||
|
||||
if( caps and bmCap1_LCD ) <> 0 then Include( result, capLCD );
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user