4e6cf8ea418d0bc91abd79d57f474fc390911c5f
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

1) #include "cyc_cnt.h"
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

2) #include "lcd.h"
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

3) #include "leds.h"
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

4) #include "switches.h"
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

5) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

6) const int myconst = 0x12345678;
7) 
8) int myvar = 0x11223344;
9) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

10) volatile int data[100];
11) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

12) void switches(void)
13) {
14)   lcd_chr(1, 0, switches_get_state(sw_0) ? '0' : ' ');
15)   lcd_chr(1, 1, switches_get_state(sw_1) ? '1' : ' ');
16)   lcd_chr(1, 2, switches_get_state(sw_2) ? '2' : ' ');
17)   lcd_chr(1, 3, switches_get_state(sw_3) ? '3' : ' ');
18)   lcd_chr(1, 4, switches_get_state(sw_east) ? 'E' : ' ');
19)   lcd_chr(1, 5, switches_get_state(sw_north) ? 'N' : ' ');
20)   lcd_chr(1, 6, switches_get_state(sw_south) ? 'S' : ' ');
21)   lcd_chr(1, 7, switches_get_state(sw_west) ? 'W' : ' ');
22)   lcd_chr(1, 8, switches_get_state(sw_center) ? 'C' : ' ');
23)   lcd_chr(1, 9, switches_get_state(sw_rot_a) ? 'a' : ' ');
24)   lcd_chr(1, 10, switches_get_state(sw_rot_b) ? 'b' : ' ');
Stefan Schuermans implemented displaying rota...

Stefan Schuermans authored 12 years ago

25) 
26)   unsigned int cnt = switches_get_rot_cnt();
27)   lcd_chr(1, 12, '0' + (cnt >> 9 & 0x7));
28)   lcd_chr(1, 13, '0' + (cnt >> 6 & 0x7));
29)   lcd_chr(1, 14, '0' + (cnt >> 3 & 0x7));
30)   lcd_chr(1, 15, '0' + (cnt & 0x7));
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

31) }
32) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

33) void delay(void)
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

34) {
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

35)   unsigned int i;
36)   for (i = 0; i < 10; ++i) {
37)     switches();
38)     cyc_cnt_delay_ms(20);
39)   }
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

40) }
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

41) 
42) int main()
43) {
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

44)   unsigned int i;
45) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

46)   for (i = 0; i < sizeof(data) / sizeof(data[0]); ++i)
47)     data[i] = i;
48) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

49)   lcd_init();
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

50)   lcd_str(0, "MIPS I system");
51)   lcd_str(1, "");
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

52) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

53)   while (1) {
54)     for (i = 0x1; i < 0x80; i <<= 1) {
55)       leds_set_state(i);
56)       delay();
57)     }
58)     for (i = 0x80; i > 0x1; i >>= 1) {
59)       leds_set_state(i);
60)       delay();
61)     }
62)   }
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

63)