DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
|
Represents a chunk of physical address space of DHCOM module. More...
#include <PhysMem.h>
Public Member Functions | |
PhysMem (uint32_t physAddress, uint32_t length) | |
Creates the PhysMem object and remembers the related segment of the physical addresses. | |
~PhysMem () | |
Destroys an object of the class, closing it if necessary. | |
STATUS | open () |
Claims the physical address space. | |
STATUS | close () |
Releases the physical address space. | |
bool | isOpen () const |
Checks if the physical address space was opened and is accessible. | |
void * | getAddress () const |
Returns the virtual address for access to the represented physical address space. | |
void * | getAddress (uint32_t offset) const |
uint32_t | getLength () const |
Get the length of the physical address segment. | |
Represents a chunk of physical address space of DHCOM module.
Important: On Linux systems root privileges are required to map physical memory.
Creates the PhysMem object and remembers the related segment of the physical addresses.
physAddress | - start of the physical address space. |
length | - the length of the address space in bytes. |
dhcom::PhysMem::~PhysMem | ( | ) |
Destroys an object of the class, closing it if necessary.
STATUS dhcom::PhysMem::close | ( | ) |
Releases the physical address space.
void * dhcom::PhysMem::getAddress | ( | ) | const |
Returns the virtual address for access to the represented physical address space.
|
inline |
uint32_t dhcom::PhysMem::getLength | ( | ) | const |
Get the length of the physical address segment.
bool dhcom::PhysMem::isOpen | ( | ) | const |
Checks if the physical address space was opened and is accessible.
STATUS dhcom::PhysMem::open | ( | ) |
Claims the physical address space.