-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathENC28J60Buffer.h
46 lines (34 loc) · 973 Bytes
/
ENC28J60Buffer.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
45
#ifndef ENC28J60BUFFER_H
#define ENC28J60BUFFER_H
#include <stdint.h>
#include <OffsetBuffer.h>
class ENC28J60Driver;
#include "ENC28J60Driver.h"
class ENC28J60Buffer: public Buffer {
ENC28J60Driver* driver;
uint16_t bufferStart;
uint16_t bufferEnd;
uint16_t payloadPointer;
uint16_t len;
bool wrap;
public:
ENC28J60Buffer(ENC28J60Driver* driver,
uint16_t startAddress,
uint16_t endAddress,
uint16_t len,
uint16_t payloadPointer = 0,
bool wrap = false);
uint16_t size();
bool write(uint16_t offset, const void* data, uint16_t len);
bool read(uint16_t offset, void* data, uint16_t len);
void setPayloadPointer(uint16_t offset);
bool copyTo(Buffer* dest,uint16_t dest_start=0,
uint16_t src_start = 0, uint16_t len = 0);
bool copyFrom(Buffer* destination,
uint16_t dest_start=0,
uint16_t src_start = 0,
uint16_t len = 0);
uint8_t getBufferType();
const static uint8_t BufferType = 3;
};
#endif