mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-10 07:30:09 +00:00
629efe6da5
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@220 aa027e90-d47c-11dd-86d7-074df07e0730
46 lines
936 B
C++
46 lines
936 B
C++
#ifndef __DEVICE_ADAPTOR_H__
|
|
#define __DEVICE_ADAPTOR_H__
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace Device {
|
|
|
|
class Adaptor
|
|
{
|
|
public:
|
|
virtual ~Adaptor();
|
|
virtual void readBlock(unsigned block, void *bp) = 0;
|
|
virtual void writeBlock(unsigned block, const void *bp) = 0;
|
|
};
|
|
|
|
|
|
class POAdaptor : public Adaptor
|
|
{
|
|
public:
|
|
POAdaptor(void *address);
|
|
virtual void readBlock(unsigned block, void *bp);
|
|
virtual void writeBlock(unsigned block, const void *bp);
|
|
private:
|
|
uint8_t *_address;
|
|
};
|
|
|
|
class DOAdaptor : public Adaptor
|
|
{
|
|
public:
|
|
DOAdaptor(void *address);
|
|
virtual void readBlock(unsigned block, void *bp);
|
|
virtual void writeBlock(unsigned block, const void *bp);
|
|
private:
|
|
uint8_t *_address;
|
|
|
|
static unsigned Map[];
|
|
};
|
|
|
|
// TODO -- nibble adaptor.
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|