6360daf373131e7bf9a40752ff9ca20bda0a4ea6
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 added debug output functions

Stefan Schuermans authored 12 years ago

3) #include "debug.h"
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

11) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

13) 
Stefan Schuermans implement menu on LCD

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

27)   void *vptr;
Stefan Schuermans remove unused variable

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

32) }
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

33) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

54) }
55) 
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

56) int main()
57) {
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

58)   leds_set_state(0x01);
59) 
Stefan Schuermans added debug output functions

Stefan Schuermans authored 12 years ago

60)   uart_cfg_scale(62); /* 115200 */
61)   uart_cfg_bits(8);
62)   uart_cfg_stop(1);
63)   debug_str("MIPS I\r\n");
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

64) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

66) 
Stefan Schuermans added debug output functions

Stefan Schuermans authored 12 years ago

67)   menu_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 added debug output functions

Stefan Schuermans authored 12 years ago

71)   eth_mac_init();
72)   eth_rx_init();
73)   eth_tx_init();
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

74) 
75)   leds_set_state(0x08);
76) 
77)   arp_init();
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

79) 
Stefan Schuermans implemented ethernet RX bus...

Stefan Schuermans authored 12 years ago

80)   leds_set_state(0x10);
81) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

82)   while (1) {
Stefan Schuermans added debug output functions

Stefan Schuermans authored 12 years ago

83)     unsigned int start_cyc = cyc_cnt_read();
Stefan Schuermans improve 200ms tick and task...

Stefan Schuermans authored 12 years ago

84)     while (cyc_cnt_read() - start_cyc < 200 * CYC_CNT_MS)
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

85)       tasks();
86)     tick200();
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

88)