root/branches/follower/libw5100/src/libw5100/w5100_device.h

Revision 140, 0.9 KB (checked in by follower, 11 months ago)

Add author, license and copyright details. (Which weren't permitted in competition entry source.)

Line 
1/*
2
3  W5100 device configuration
4
5  Author:
6
7     Philip Lindsay <follower@rancidbacon.com>
8
9  License:
10
11     Copyright 2007-2008 // LGPL
12
13*/
14
15#ifndef _W5100_DEVICE_H_
16#define _W5100_DEVICE_H_
17
18// From original driver
19#include "types.h"
20#include "w5100.h"
21#include "socket.h"
22
23// Required for use in Arduino environment
24#include <WConstants.h>
25
26class W5100Device {
27 
28  public:
29    W5100Device(int resetPin);
30   
31    void setIp(byte b0, byte b1, byte b2, byte b3);
32    void setMask(byte b0, byte b1, byte b2, byte b3);
33    void setGateway(byte b0, byte b1, byte b2, byte b3);
34    void setMac(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5);
35
36    void _init(void);
37 
38  private:
39    byte * _packBuffer(byte b0, byte b1, byte b2, byte b3);
40    byte * _packBuffer(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5);
41   
42    int _resetPin;
43
44    byte _scratchBuffer[6];   // TODO: Can we make this static?
45};
46
47#endif
Note: See TracBrowser for help on using the browser.