DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
PhysMem.h
Go to the documentation of this file.
1 /*
2  * PhysMem.h
3  *
4  * Created on: 07.11.2012
5  * Author: Peter Kishalov (PK), DH electronics GmbH
6  */
7 
8 #ifndef PHYSMEM_H_
9 #define PHYSMEM_H_
10 
11 
12 #include <DHCOM_HAL.h>
13 #include <hal/Types.h>
14 
15 
16 namespace dhcom
17 {
18 
19 
20 class PhysMemImpl;
21 
22 
24 {
25 public:
26  PhysMem(uint32_t physAddress, uint32_t length);
27  ~PhysMem();
28 
29  STATUS open();
30  STATUS close();
31  bool isOpen() const;
32 
33  void * getAddress() const;
34  void * getAddress(uint32_t offset) const { return static_cast <uint8_t *> (getAddress()) + offset; }
35  uint32_t getLength() const;
36 
37 private:
38  PhysMemImpl * const impl_;
39 };
40 
41 
94 }
95 
96 
97 #endif /* PHYSMEM_H_ */