Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TkdHWRangeRegister

Unit

kdregister

Declaration

type TkdHWRangeRegister = class(TkdResource)

Description

Final resource class TkdHWRangeRegister models hardware register related to some address range of hardware, either memory or port concerned, i.e. a descendant of TkdHWRange class. It includes properties for specifying the targeted address range for the register, the offset of the register within the range, the size of the register and the access mode to it. Use Value property to actually read from or write to the register.

Hierarchy

TkdResource

Methods

Overview

Protectedfunction CheckResourceDataReadiness: Boolean; override;
Protectedfunction GetRegisterPriority: Byte; override;
Publicclass function GetRegisterSize (Value: TkdHWRangeRegisterSize): Byte;
Protectedprocedure Notification (AComponent: TComponent; Operation: TOperation); override;
Protectedprocedure RaiseOnRemoveItem; override;
Protectedprocedure SetName(const NewName: TComponentName); override;

Description

Protectedfunction CheckResourceDataReadiness: Boolean; override;

CheckResourceDataReadiness method is overridden to make sure its targeted address range is specified through HWRange property and message if not.

Protectedfunction GetRegisterPriority: Byte; override;

GetRegisterPriority method is overridden to result dependent1l_registration_priority constant, so that to allow the targeted address range specified via HWRange property to be registered ahead. The method does not result a lower priority constant because the register can be referenced by any resource of TkdInterrupt class in its hardware interrupt handler script hosted at InterruptHandler property.

Publicclass function GetRegisterSize (Value: TkdHWRangeRegisterSize): Byte;

GetRegisterSize class method determines the integer size(width) of a register whose size(width) is known as the value of TkdHWRangeRegisterSize enumeration type.

Protectedprocedure Notification (AComponent: TComponent; Operation: TOperation); override;

Notification method is overridden to respond to notification that the targeted address range is about to be destroyed. It updates properties so that HWRange property points to nothing, Offset and Size properties are set to their default 0 and rsByte values correspondingly.

Protectedprocedure RaiseOnRemoveItem; override;

RaiseOnRemoveItem method is overridden to prevent from detaching the register from the resources list of the hardware device if the register is currently referenced by at least one resource of TkdInterrupt class in its hardware interrupt handler script hosted at InterruptHandler property.

Protectedprocedure SetName(const NewName: TComponentName); override;

SetName method is overridden to update all references to the register. This is because the register can be referenced by name by any resource of TkdInterrupt class in its hardware interrupt handler script hosted at InterruptHandler property.

Properties

Overview

Publishedproperty AutoRead: Boolean;
Publishedproperty HWRange: TkdHWRange;
Publishedproperty Offset: LongWord;
Publishedproperty Size: TkdHWRangeRegisterSize;
Publishedproperty UseMode: TkdHWRangeRegisterUseMode;
Publicproperty Value: LongWord;

Description

Publishedproperty AutoRead: Boolean;

AutoRead property specifies whether the register has to be automatically read-in right away as any of the remaining registers on the targeted address range is being also accessed.

Publishedproperty HWRange: TkdHWRange;

HWRange property specifies the targeted address range the register is located on. The register is in every respect illegal if this property is not specified.

Publishedproperty Offset: LongWord;

Offset property specifies the offset of the register within the targeted address range.

Publishedproperty Size: TkdHWRangeRegisterSize;

Size property specifies the size of the register.

Publishedproperty UseMode: TkdHWRangeRegisterUseMode;

UseMode property specifies the access mode to the register. If an application tries to write to a read-only register or read from a write-only register, be sure the GDD checks it and refuses to complete.

Publicproperty Value: LongWord;

Value property is an accessor for reading from and writing to the register.