stipcores library
Collection of Software Drivers for Hardware IP Cores for the Panoradio SDR
IP_Driver.h
1 #ifndef IP_DRIVER_H
2 #define IP_DRIVER_H
3 
4 /*
5  -------------------------------------------------------
6  IP_Driver.h
7  generic class for an IP core driver over AXI Lite
8  Stefan Scholl, DC9ST, TU Kaiserslautern, 2014
9  -------------------------------------------------------
10 */
11 
14 class IP_Driver {
15 
16 public:
17  IP_Driver();
18 
22  IP_Driver(int base_address, int size_in_k);
23 
24  ~IP_Driver();
25 
29  void write(int address, int data);
30 
34  int read(int address);
35 
36 private:
37  int fd; // File Handler
38  volatile void *ptr; // pointer to mapped memory in virtual adress space
39  int mem_size; // size of mapped memory (unit: adresses)
40  int page_offset; // offset between IP adress and lower page bound
41 };
42 
43 #endif /* IP_DRIVER_H */
Generic IP Driver Class Class, that allows access to a AXI Lite IP core over the Zynq Memory Mapped I...
Definition: IP_Driver.h:14
int read(int address)
reads data from an ip core
Definition: IP_Driver.cpp:62
void write(int address, int data)
writes data to an ip core
Definition: IP_Driver.cpp:58