2024-02-09 23:30:47 +00:00
|
|
|
<?php
|
|
|
|
|
namespace Targets;
|
|
|
|
|
|
|
|
|
|
use Targets\TargetDescriptionFiles\TargetDescriptionFile;
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ . "/TargetRegisterBitField.php";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Do not confuse this with `TargetDescriptionFiles\Register` - that class represents a <register> element in a TDF,
|
|
|
|
|
* which is part of some unresolved register group.
|
|
|
|
|
*
|
|
|
|
|
* This class represents a **resolved** target register, within a register group, within a target peripheral. With
|
|
|
|
|
* this class, we can access the absolute address of the register.
|
|
|
|
|
*
|
|
|
|
|
* This class is constructed from a `TargetDescriptionFiles\Register` object.
|
|
|
|
|
* @see TargetDescriptionFile::getTargetRegister() for more.
|
|
|
|
|
*/
|
|
|
|
|
class TargetRegister
|
|
|
|
|
{
|
|
|
|
|
public ?string $key = null;
|
|
|
|
|
public ?string $name = null;
|
2024-07-07 17:25:56 +01:00
|
|
|
public ?string $addressSpaceKey = null;
|
2024-02-09 23:30:47 +00:00
|
|
|
public ?int $address = null;
|
|
|
|
|
public ?int $size = null;
|
|
|
|
|
public ?string $description = null;
|
|
|
|
|
|
|
|
|
|
/** @var TargetRegisterBitField[] */
|
|
|
|
|
public array $bitFields;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
?string $key,
|
|
|
|
|
?string $name,
|
2024-07-07 17:25:56 +01:00
|
|
|
?string $addressSpaceKey,
|
2024-02-09 23:30:47 +00:00
|
|
|
?int $address,
|
|
|
|
|
?int $size,
|
|
|
|
|
?string $description,
|
|
|
|
|
array $bitFields
|
|
|
|
|
) {
|
|
|
|
|
$this->key = $key;
|
|
|
|
|
$this->name = $name;
|
2024-07-07 17:25:56 +01:00
|
|
|
$this->addressSpaceKey = $addressSpaceKey;
|
2024-02-09 23:30:47 +00:00
|
|
|
$this->address = $address;
|
|
|
|
|
$this->size = $size;
|
|
|
|
|
$this->description = $description;
|
|
|
|
|
$this->bitFields = $bitFields;
|
|
|
|
|
}
|
|
|
|
|
}
|