You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.5 KiB
77 lines
1.5 KiB
/**
|
|
* Arduino adaptation of AVRLib's netstack test and ENC28J60 driver.
|
|
* Cleft under a CC BY-SA-NC 2.5 (Matthieu Lalonde)
|
|
* Go to creativecommons.org for the full license.
|
|
**/
|
|
|
|
#ifndef Main_H
|
|
#define Main_H
|
|
|
|
/**
|
|
* Libraries
|
|
**/
|
|
// Program strings support
|
|
#include <avr/pgmspace.h>
|
|
#include "programStrings.h"
|
|
|
|
// AVRLib defs & types compatibility
|
|
#include "avrlibdefs.h"
|
|
#include "avrlibtypes.h"
|
|
|
|
/**
|
|
* Network support
|
|
**/
|
|
|
|
// PHY level
|
|
#include "nic.h"
|
|
#include "enc28j60.h"
|
|
|
|
// Net Stack
|
|
#include "net.h"
|
|
#include "netstack.h"
|
|
#include "arp.h"
|
|
#include "ip.h"
|
|
#include "icmp.h"
|
|
|
|
/**
|
|
* Definitions
|
|
**/
|
|
#define pinLED 7
|
|
|
|
// Network options
|
|
#define IPADDRESS IPDOT(192l,168l,0l,126l)
|
|
#define NETMASK IPDOT(255l,255l,0l,0l)
|
|
#define GATEWAY IPDOT(192l,168l,255l,255l)
|
|
|
|
#define ETHADDR0 0xCC /*'78'*/
|
|
#define ETHADDR1 0x00 /*'53'*/
|
|
#define ETHADDR2 0xFF /*'6D'*/
|
|
#define ETHADDR3 0xFF /*'75'*/
|
|
#define ETHADDR4 0xEE /*'72'*/
|
|
#define ETHADDR5 0xEE /*'66'*/
|
|
|
|
#define LOOPBACK_PORT 7 // UDP packets sent to this port will be returned to sender
|
|
#define CONTROL_PORT 4950 // UDP packets sent to this port will be used for control
|
|
#define SERIAL_PORT 4951 // UDP packets sent to this port will be printed via serial
|
|
|
|
/**
|
|
* Macros
|
|
**/
|
|
#ifndef nop
|
|
#define nop() __asm__ __volatile__ ("nop")
|
|
#endif
|
|
|
|
#ifndef __AVR_ATmega168__
|
|
#define __AVR_ATmega168__
|
|
#endif
|
|
|
|
/**
|
|
* Function prototypes
|
|
**/
|
|
void processCommand(u16 len, u08* data);
|
|
void serviceLocal(void);
|
|
void setup(void);
|
|
void loop(void);
|
|
|
|
#endif
|