1
0
mirror of https://github.com/danog/fast-gpio.git synced 2024-11-26 20:04:37 +01:00
fast-gpio/include/module.h
2016-08-15 15:29:18 -04:00

44 lines
909 B
C++

#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 &regVal, int bitNum, int value);
int _GetBit (unsigned long int regVal, int bitNum);
// protected members
int verbosityLevel;
int debugLevel;
unsigned long int *regAddress;
};
#endif // _MODULE_H_