5e29ab5c1287f6e59d5a72ce0a91ff355756bcf1
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' : ' ');
25) }
26) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

28) {
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

29)   unsigned int i;
30)   for (i = 0; i < 10; ++i) {
31)     switches();
32)     cyc_cnt_delay_ms(20);
33)   }
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

34) }
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

35) 
36) int main()
37) {
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

38)   unsigned int i;
39) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

40)   for (i = 0; i < sizeof(data) / sizeof(data[0]); ++i)
41)     data[i] = i;
42) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

43)   lcd_init();
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

47)   while (1) {
48)     for (i = 0x1; i < 0x80; i <<= 1) {
49)       leds_set_state(i);
50)       delay();
51)     }
52)     for (i = 0x80; i > 0x1; i >>= 1) {
53)       leds_set_state(i);
54)       delay();
55)     }
56)   }
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

57)