c89d9992c4628f399e5952d7c53388403f7e12a7
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

1) #include "arp.h"
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

2) #include "cyc_cnt.h"
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

3) #include "dhcp.h"
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

4) #include "eth.h"
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

5) #include "ip.h"
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

6) #include "leds.h"
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

7) #include "menu.h"
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

8) #include "uart.h"
9) #include "udp.h"
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

10) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

11) unsigned char leds_val = 0x88;
Stefan Schuermans send ethernet packet on cen...

Stefan Schuermans authored 12 years ago

12) 
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

13) void uart_rx_task(void)
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

14) {
15)   unsigned short chr;
16) 
17)   while (uart_can_rx()) {
18)     chr = uart_rx();
Stefan Schuermans improve 200ms tick and task...

Stefan Schuermans authored 12 years ago

19)     if (!uart_is_err(chr))
20)       uart_tx(chr);
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

21)   }
22) }
23) 
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

24) void eth_rx_task(void)
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

25) {
Stefan Schuermans implemented ethernet TX fir...

Stefan Schuermans authored 12 years ago

26)   void *vptr;
Stefan Schuermans remove unused variable

Stefan Schuermans authored 12 years ago

27)   unsigned int sz;
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

28) 
Stefan Schuermans improve 200ms tick and task...

Stefan Schuermans authored 12 years ago

29)   while (eth_rx(&vptr, &sz))
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

30)     ethernet_recv(vptr, sz);
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

31) }
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

32) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

33) void tasks(void)
34) {
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

35)   uart_rx_task();
36)   eth_rx_task();
37)   menu_task();
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

38) }
39) 
40) void leds_tick200(void)
41) {
42)   leds_val = leds_val << 1 | leds_val >> 7;
43)   leds_set_state(leds_val);
44) }
45) 
46) void tick200(void)
47) {
48)   leds_tick200();
49)   arp_tick200();
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

50)   ip_tick200();
51)   udp_tick200();
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

52)   dhcp_tick200();
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

53) }
54) 
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

55) int main()
56) {
Stefan Schuermans improve 200ms tick and task...

Stefan Schuermans authored 12 years ago

57)   unsigned int start_cyc;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

58) 
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

59)   leds_set_state(0x01);
60) 
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

61)   menu_init();
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

62) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

63)   leds_set_state(0x02);
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

64) 
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

65)   eth_mac_init();
66)   eth_rx_init();
67)   eth_tx_init();
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

68) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

69)   leds_set_state(0x04);
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

70) 
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

71)   uart_cfg_scale(62); /* 115200 */
72)   uart_cfg_bits(8);
73)   uart_cfg_stop(1);
74)   uart_tx('M');
75)   uart_tx('I');
76)   uart_tx('P');
77)   uart_tx('S');
78)   uart_tx(' ');
79)   uart_tx('I');
80)   uart_tx('\r');
81)   uart_tx('\n');
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

82) 
83)   leds_set_state(0x08);
84) 
85)   arp_init();
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

86)   ip_init();
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

87) 
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

88)   leds_set_state(0x10);
89) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

90)   while (1) {
Stefan Schuermans improve 200ms tick and task...

Stefan Schuermans authored 12 years ago

91)     start_cyc = cyc_cnt_read();
92)     while (cyc_cnt_read() - start_cyc < 200 * CYC_CNT_MS)
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

93)       tasks();
94)     tick200();
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

95)   }
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

96)