-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.h
44 lines (30 loc) · 918 Bytes
/
module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _MODULE_H_
#define _MODULE_H_
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
class Module {
public:
Module(void);
~Module(void);
void SetVerbosity (int input);
void SetVerbosity (bool input);
void SetDebugMode (int input);
void SetDebugMode (bool input);
protected:
// protected functions
int _SetupAddress (unsigned long int blockBaseAddr, unsigned long int blockSize);
void _WriteReg (unsigned long int registerOffset, unsigned long int value);
unsigned long int _ReadReg (unsigned long int registerOffset);
void _SetBit (unsigned long int ®Val, int bitNum, int value);
int _GetBit (unsigned long int regVal, int bitNum);
// protected members
int verbosityLevel;
int debugLevel;
volatile unsigned long int *regAddress;
};
#endif // _MODULE_H_