2010-05-18 02:58:26 +00:00
|
|
|
#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);
|
2010-05-18 19:59:18 +00:00
|
|
|
virtual void readBlock(unsigned block, void *bp);
|
|
|
|
virtual void writeBlock(unsigned block, const void *bp);
|
2010-05-18 02:58:26 +00:00
|
|
|
private:
|
|
|
|
uint8_t *_address;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DOAdaptor : public Adaptor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DOAdaptor(void *address);
|
2010-05-18 19:59:18 +00:00
|
|
|
virtual void readBlock(unsigned block, void *bp);
|
|
|
|
virtual void writeBlock(unsigned block, const void *bp);
|
2010-05-18 02:58:26 +00:00
|
|
|
private:
|
|
|
|
uint8_t *_address;
|
|
|
|
|
|
|
|
static unsigned Map[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// TODO -- nibble adaptor.
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|