fdhwlib
2.0.25
|
#include <baseregister.h>
The class contains the register address modell of the SLT board.
The individual register address is calculated from the slot ID and the register ID.
The register implementation contains a cache function to avoid unneccessary access to the hardware. To decode the status bits the cache content can be used without storing any additional intermediate data.
Definition at line 148 of file baseregister.h.
hw4::BaseRegister::BaseRegister | ( | const char * | name, |
int | slotID, | ||
unsigned int | regID, | ||
int | r, | ||
int | w, | ||
int | len = 1 , |
||
int | addrShift = 0 , |
||
int | blockLen = 1 , |
||
bool | useCache = true |
||
) |
A register (slt object) is defined by it's name and the combination of slot ID and register ID.
Every register also posses the properties readable and writeable. The register object can also be used to access register vectors and memories. For a register vector the number of elements and the address shift needs to be specified. A memory need also this both parameters. Memoreis span a contiuous space so that block access can be used to get the data for all elements.
virtual hw4::BaseRegister::~BaseRegister | ( | ) | [virtual] |
The destructor deletes all entries from the item list when called.
Do not remove the item list in the specific register implementation.
virtual int hw4::BaseRegister::getActiveBits | ( | int | elem = 0 , |
unsigned long | mask = 0xffffffff |
||
) | [virtual] |
Get number of active bits.
unsigned long hw4::BaseRegister::getAddr | ( | ) |
Get address.
unsigned long hw4::BaseRegister::getAddrShift | ( | ) |
int hw4::BaseRegister::getBlockLength | ( | ) |
unsigned long hw4::BaseRegister::getCache | ( | int | elem = 0 , |
int | line = 0 |
||
) |
Get the cache value.
This command will not read any data from the hardware.
void hw4::BaseRegister::getCache | ( | unsigned long * | data | ) |
virtual int hw4::BaseRegister::getLength | ( | ) | [virtual] |
Reimplemented in hw4::SltByteRegister, and hw4::FltMemory.
const char* hw4::BaseRegister::getName | ( | ) |
bool hw4::BaseRegister::isCacheEnabled | ( | ) |
Cache management.
If the cache is disabled any access to the cache will cause an exception.
bool hw4::BaseRegister::isReadable | ( | ) |
bool hw4::BaseRegister::isWriteable | ( | ) |
virtual unsigned long hw4::BaseRegister::read | ( | ) | [virtual] |
Read the register return the data and store it in the object cache.
Default: Read all data
Reimplemented in hw4::FltPeriphRegister, hw4::SltCounter, hw4::BaseRegister64, and hw4::SltSecondCounter.
virtual unsigned long hw4::BaseRegister::read | ( | int | elem | ) | [virtual] |
Read the register return the data and store it in the object cache.
Read all data of a element.
Reimplemented in hw4::FltPeriphRegister.
virtual unsigned long hw4::BaseRegister::read | ( | int | elem, |
int | line | ||
) | [virtual] |
Read the register return the data and store it in the object cache.
Reads all 'line's of item number 'elem'.
Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.
virtual void hw4::BaseRegister::readBlock | ( | unsigned long * | data | ) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
Reimplemented in hw4::FltPeriphRegister, and hw4::BaseFIFO.
virtual void hw4::BaseRegister::readBlock | ( | unsigned long * | data, |
unsigned long | blockLen | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
Reimplemented in hw4::BaseFIFO.
virtual void hw4::BaseRegister::readBlock | ( | unsigned long * | data, |
unsigned long | start, | ||
unsigned long | blockLen | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::readBlock | ( | int | elem, |
unsigned long * | data | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::readBlock | ( | int | elem, |
unsigned long * | data, | ||
unsigned long | blockLen | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::readBlock | ( | int | elem, |
unsigned long * | data, | ||
unsigned long | start, | ||
unsigned long | blockLen | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::readElements | ( | int | elem0, |
int | elem1, | ||
unsigned long * | data | ||
) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::readElements | ( | unsigned long * | data = 0 | ) | [virtual] |
Read all elements of the register vector return the data and store it in the object cache.
virtual void hw4::BaseRegister::setBitsToHigh | ( | unsigned long | mask | ) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::setBitsToHigh | ( | int | elem, |
unsigned long | mask | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::setBitsToLow | ( | unsigned long | mask | ) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::setBitsToLow | ( | int | elem, |
unsigned long | mask | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
void hw4::BaseRegister::setCache | ( | unsigned long | data | ) |
Write data to cache.
Reimplemented in hw4::FltPeriphRegister.
void hw4::BaseRegister::setCache | ( | int | elem, |
unsigned long | data | ||
) |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::setCacheBits | ( | unsigned long | data, |
unsigned long | mask, | ||
int | shift | ||
) | [virtual] |
Modify data in cache.
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::setCacheBits | ( | int | elem, |
unsigned long | data, | ||
unsigned long | mask, | ||
int | shift | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::write | ( | unsigned long | data | ) | [virtual] |
Write data to hardware.
The write access is not cached.
Reimplemented in hw4::FltPeriphRegister, hw4::SltCounter, and hw4::BaseRegister64.
virtual void hw4::BaseRegister::write | ( | int | elem, |
unsigned long | data | ||
) | [virtual] |
Write a single register element.
The write access is not cached.
Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.
virtual void hw4::BaseRegister::write | ( | int | elem, |
int | line, | ||
unsigned long | data | ||
) | [virtual] |
Write a single register element.
The write access is not cached.
Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.
virtual void hw4::BaseRegister::write | ( | unsigned long * | data | ) | [virtual] |
Write all elemens of a register vector.
The write access is not cached.
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::writeBits | ( | unsigned long | data, |
unsigned long | mask, | ||
int | shift | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::writeBits | ( | int | elem, |
unsigned long | data, | ||
unsigned long | mask, | ||
int | shift | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::writeBits | ( | int | elem, |
int | line, | ||
unsigned long | data, | ||
unsigned long | mask, | ||
int | shift | ||
) | [virtual] |
Reimplemented in hw4::FltPeriphRegister.
virtual int hw4::BaseRegister::writeBitsByName | ( | char * | name, |
unsigned long | data | ||
) | [virtual] |
Set a bit field by name.
The bit field have to be defined in the specialized classes.
name | name of the bit field |
data | vaues to write to the specified bit field |
virtual void hw4::BaseRegister::writeCache | ( | ) | [virtual] |
Write cache to hardware.
virtual void hw4::BaseRegister::writeCache | ( | int | elem | ) | [virtual] |
Write cache to hardware.
Reimplemented in hw4::FltPeriphRegister.
virtual void hw4::BaseRegister::writeCache | ( | int | elem, |
int | line | ||
) | [virtual] |
Write cache to hardware.
unsigned long hw4::BaseRegister::addr [protected] |
Definition at line 318 of file baseregister.h.
unsigned long hw4::BaseRegister::addrShift [protected] |
Definition at line 320 of file baseregister.h.
int hw4::BaseRegister::blockLen [protected] |
Definition at line 324 of file baseregister.h.
unsigned long* hw4::BaseRegister::cache [protected] |
The register cache contains the last data returned from the hardware.
It can also be used to sample and assemble data from different items before sending the data.
Definition at line 343 of file baseregister.h.
bool hw4::BaseRegister::hasCBWOBits [protected] |
Definition at line 334 of file baseregister.h.
bool hw4::BaseRegister::isMemory [protected] |
Definition at line 336 of file baseregister.h.
List of items in the register.
Definition at line 290 of file baseregister.h.
Number of bit fields.
Definition at line 293 of file baseregister.h.
int hw4::BaseRegister::len [protected] |
Definition at line 322 of file baseregister.h.
const char* hw4::BaseRegister::name [protected] |
Definition at line 326 of file baseregister.h.
bool hw4::BaseRegister::readable [protected] |
Definition at line 328 of file baseregister.h.
bool hw4::BaseRegister::useCache [protected] |
Definition at line 332 of file baseregister.h.
bool hw4::BaseRegister::writeable [protected] |
Definition at line 330 of file baseregister.h.