libdrmconf 0.14.1
A library to program DMR radios.
Loading...
Searching...
No Matches
DM32UV::AddressMap Class Reference

Implements a memory map between physical and virtual codeplug addresses. More...

#include <dm32uv.hh>

Public Member Functions

 AddressMap ()
 Default constructor.
 AddressMap (const AddressMap &other)=default
 Default copy constructor.
void map (uint32_t phys, uint32_t virt)
 Adds an address mapping.
bool virtualIsMapped (uint32_t virt) const
 Returns true, if the virtual address is mapped.
bool physicalIsMapped (uint32_t virt) const
 Returns true, if the physical address is mapped.
uint32_t toVirtual (uint32_t phys) const
 Maps the given physical address to a virtual codeplug address.
uint32_t toPhysical (uint32_t virt) const
 Maps the given virtual codeplug address to a physical memory address.
QList< uint32_t > mappedPhysical () const
 Returns the map from physical to virtual addresses, sorted by physical addresses.
QList< uint32_t > mappedVirtual () const
 Returns the map from virtual to physical addresses, sorted by virtual addresses.

Protected Attributes

QMap< uint32_t, uint32_t > _toVirtual
 Holds only the prefix address mapping from physical to virtual addresses.
QMap< uint32_t, uint32_t > _toPhysical
 Holds only the prefix address mapping from virtual to physical addresses.

Detailed Description

Implements a memory map between physical and virtual codeplug addresses.

The addresses, the codeplug is encoded in, are virtual. These codeplug blocks are then written to different physical addresses.

Member Function Documentation

◆ toPhysical()

uint32_t DM32UV::AddressMap::toPhysical ( uint32_t virt) const

Maps the given virtual codeplug address to a physical memory address.

If virtual address is unknown – that is, not mapped – std::numeric_limits<uint32_t>::max() gets returned.

◆ toVirtual()

uint32_t DM32UV::AddressMap::toVirtual ( uint32_t phys) const

Maps the given physical address to a virtual codeplug address.

If physical address is unknown – that is, not mapped – std::numeric_limits<uint32_t>::max() gets returned.

Member Data Documentation

◆ _toPhysical

QMap<uint32_t, uint32_t> DM32UV::AddressMap::_toPhysical
protected

Holds only the prefix address mapping from virtual to physical addresses.

That is addr>>12.

◆ _toVirtual

QMap<uint32_t, uint32_t> DM32UV::AddressMap::_toVirtual
protected

Holds only the prefix address mapping from physical to virtual addresses.

That is addr>>12.


The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv.hh
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv.cc