type TkdHWRange = class(
TkdRange
)
Transfer
method that initiates data reading and writing operations on hardware and it introduces properties which specify rules for the transfer. By making up multifarious combination over values of the properties, required transfer operations can be easily composed. The class also introduces a number of virtual methods intended to be overridden by its port-oriented and memory-oriented descendants, including those checking the self-consistency and the inter-consistency of all instances of this class, and those maintaining instances of the dependent class TkdHWRangeRegister
.TkdRange
> TkdResource
![]() | procedure CheckOverlappedRanges (IsRangeShared: Boolean; ARangeFrom, ARangeTo: LongWord); |
![]() | procedure CheckRangeFrom (Value: String); override; |
![]() | procedure CheckRangeTo (Value: String); override; |
![]() | procedure CheckRegistersValidities (RngFrom, RngTo: LongWord); |
![]() | procedure CheckRegisterValidity (RngFrom, RngTo: LongWord; ARegister: TkdResource); virtual; |
![]() | procedure CheckTransferAutoInc (TransferAutoIncValue: Boolean); virtual; |
![]() | procedure CheckTransferPropsIntegrity (ARangeFrom, ARangeTo: LongWord; AnTransferAutoInc: Boolean; ATransferCount: LongWord; ATransferSize: TkdHWRangeTransferSize; ATransferOffset: LongWord); virtual; |
![]() | function GetRegisterPriority: Byte; override; |
![]() | class function GetTransferSize (Value: TkdHWRangeTransferSize): Byte; |
![]() | procedure PrepareTransferStruct (ABuffer: Pointer; ABufferSize: LongWord); virtual; |
![]() | function Transfer (ABuffer: Pointer; BufferSize: LongWord): LongWord; |
![]() | procedure CheckOverlappedRanges (IsRangeShared: Boolean; ARangeFrom, ARangeTo: LongWord); |
CheckOverlappedRanges method checks if there is another address range that seems overlapped and, if so, raises the corresponding exception conflict_ranges
to prohibit from the inter-consistency contradiction of the two address ranges. Two ranges are considered overlapped if these ranges are both non-shared and have a common bar of addresses. See also CheckRangeFrom
and CheckRangeTo
methods and RangeShared
property for reference.
![]() | procedure CheckRangeFrom (Value: String); override; |
CheckRangeFrom method is overridden to add additional verifications in the form of consequent calls to CheckOverlappedRanges
, CheckTransferPropsIntegrity
, and CheckRegistersValidities
methods.
![]() | procedure CheckRangeTo (Value: String); override; |
CheckRangeTo method is overridden to add additional verifications in the form of consequent calls to CheckOverlappedRanges
, CheckTransferPropsIntegrity
, and CheckRegistersValidities
methods.
![]() | procedure CheckRegistersValidities (RngFrom, RngTo: LongWord); |
CheckRegistersValidities method cyclically calls CheckRegisterValidity
method for each of hardware registers located on the address range.
![]() | procedure CheckRegisterValidity (RngFrom, RngTo: LongWord; ARegister: TkdResource); virtual; |
CheckRegisterValidity method checks if the hardware register given is located inside the address range whose bounds are given as well. If the register is illegal the corresponding exception register_out_of_range
has to be raised.
![]() | procedure CheckTransferAutoInc (TransferAutoIncValue: Boolean); virtual; |
CheckTransferAutoInc method is introduced void to be overridden if the auto-incrementation of addresses is not allowed for transfer operation. If this is the case a descendant must raise a corresponding exception.
CheckTransferPropsIntegrity method checks if all the properties responsible for transfer operations and given as agruments are set semantically consistent with the remaining ones. If it is not the case the corresponding exception (either invalid_transfer_size
or invalid_transfer_count
) is raised.
![]() | function GetRegisterPriority: Byte; override; |
GetRegisterPriority method is overridden to result independent_registration_priority
constant so that to allow any resource of this class to be registered first of all.
![]() | class function GetTransferSize (Value: TkdHWRangeTransferSize): Byte; |
GetTransferSize class method determines the integer size of a transfer operation (each transmitted operand) whose size is known as the value of TkdHWRangeTransferSize
enumeration type.
![]() | procedure PrepareTransferStruct (ABuffer: Pointer; ABufferSize: LongWord); virtual; |
PrepareTransferStruct method is introduced to provide for transfer operations the set of properties common to all descendants. Final resource class TkdPortRange
overrides this method.
![]() | function Transfer (ABuffer: Pointer; BufferSize: LongWord): LongWord; |
Transfer method accomplishes data transfer operations on the address range as provided by corresponding properties. The buffer to transfer to/from and the size of the buffer are given as arguments.
![]() | property RangeShared: Boolean; |
![]() | property TransferAutoInc: Boolean; |
![]() | property TransferCount: LongWord; |
![]() | property TransferDir: TkdHWRangeTransferDir; |
![]() | property TransferOffset: LongWord; |
![]() | property TransferSize: TkdHWRangeTransferSize; |
![]() | property RangeShared: Boolean; |
RangeShared property specifies if the address range can be shared between other kernel processes in the system or must be registered exclusively with the GDD.
![]() | property TransferAutoInc: Boolean; |
TransferAutoInc property specifies if the auto-incrementation of addresses must be put in place during transfer. If False, then all data is transferred to/from the same address of the address range.
![]() | property TransferCount: LongWord; |
TransferCount property specifies the number of data items to transfer to/from the address range.
![]() | property TransferDir: TkdHWRangeTransferDir; |
TransferDir property specifies the direction for transfer. If tdRead, then data is read from, otherwise data is written to the address range.
![]() | property TransferOffset: LongWord; |
TransferOffset property specifies the offset within the address range to begin transfer from.
![]() | property TransferSize: TkdHWRangeTransferSize; |
TransferSize property specifies the size of data item to transfer to/from the address range.