1
0
mirror of https://github.com/danog/fast-gpio.git synced 2024-11-30 04:19:09 +01:00
fast-gpio/include/module.h

42 lines
857 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);
// protected members
int verbosityLevel;
int debugLevel;
volatile unsigned long int *regAddress;
};
#endif // _MODULE_H_