Stefan Schuermans
made MAC configurable in ethernet peripheral
Stefan Schuermans commited 2ef1d95 at 2012-03-11 20:48:30
#include "cyc_cnt.h"
#include "eth.h"
#include "lcd.h"
#include "leds.h"
#include "uart.h"
#include "switches.h"
//#define CFG_SIMULATION
#define CFG_ETH_RX
#define CFG_ETH_TX
#define CFG_UART
#ifdef CFG_SIMULATION
# define CFG_UART_CHK
#else
# define CFG_DELAY
# define CFG_LCD
# define CFG_SWITCHES
#endif
const int myconst = 0x12345678;
int myvar = 0x11223344;
volatile int data[100];
#ifdef CFG_ETH_TX
static const unsigned char example_packet[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* destination MAC */
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* source MAC */
0x08, 0x00, /* ethertype: IP */
0x45, 0x00, 0x00, 0x36, /* IP header: ..., len */
0x12, 0x34, 0x00, 0x00, /* IP header: ..., not fragmented */
0x40, 0x11, 0x00, 0x00, /* IP header: ..., UDP, ... */
0x7F, 0x00, 0x00, 0x01, /* source IP */
0xFF, 0xFF, 0xFF, 0xFF, /* destination IP */
0x00, 0x01, 0x00, 0x01, /* UDP: source port, destination port */
0x00, 0x22, 0x00, 0x00, /* UDP: len, ... */
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
#endif
void switches(void)
{
#ifdef CFG_LCD
#ifdef CFG_SWITCHES
lcd_chr(1, 0, switches_get_state(sw_0) ? '0' : ' ');
lcd_chr(1, 1, switches_get_state(sw_1) ? '1' : ' ');
lcd_chr(1, 2, switches_get_state(sw_2) ? '2' : ' ');
lcd_chr(1, 3, switches_get_state(sw_3) ? '3' : ' ');
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX