Revision 906
Started working on library... Wrote about half of the stubs.
branches/simulator/projects/simulator/libsim/libsim.c | ||
---|---|---|
1 |
#include "dragonfly_lib.h" |
|
2 |
|
|
3 |
void dragonfly_init(int config) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
branches/simulator/projects/simulator/libsim/analog.c | ||
---|---|---|
1 |
#include "analog.h" |
|
2 |
|
|
3 |
void analog_init(int startConversion) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void analog_start_loop(void) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
void analog_stop_loop(void) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
unsigned int analog8(int which) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
unsigned int analog10(int which) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
|
28 |
int wheel(void) |
|
29 |
{ |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
unsigned int analog_get8(int which) |
|
34 |
{ |
|
35 |
|
|
36 |
} |
|
37 |
|
|
38 |
unsigned int analog_get10(int which) |
|
39 |
{ |
|
40 |
|
|
41 |
} |
|
42 |
|
branches/simulator/projects/simulator/libsim/buzzer.c | ||
---|---|---|
1 |
#include "buzzer.h" |
|
2 |
|
|
3 |
void buzzer_init(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void buzzer_set_val(unsigned int buzz_val) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
void buzzer_set_freq(unsigned int buzzer_freq) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
void buzzer_chirp(unsigned int ms, unsigned int buzz_freq) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
void buzzer_off(void) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
branches/simulator/projects/simulator/libsim/encoders.c | ||
---|---|---|
1 |
#include "encoders.h" |
|
2 |
|
|
3 |
void encoders_init(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
int encoder_read(char encoder) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
int encoder_get_dx(char encoder) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
void encoder_rst_dx(char encoder) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
int encoder_get_tc(void) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
|
28 |
void encoder_rst_tc(void) |
|
29 |
{ |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
void encoder_wait( int nReadings ) |
|
34 |
{ |
|
35 |
|
|
36 |
} |
|
37 |
|
branches/simulator/projects/simulator/libsim/lcd.c | ||
---|---|---|
1 |
#include "lcd.h" |
|
2 |
|
|
3 |
void lcd_init(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void lcd_clear_screen( void ) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
void lcd_putc(char c) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
void lcd_puts(char *s) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
void lcd_puti(int value) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
|
28 |
void lcd_gotoxy(int x, int y) |
|
29 |
{ |
|
30 |
|
|
31 |
} |
|
32 |
|
branches/simulator/projects/simulator/libsim/motors.c | ||
---|---|---|
1 |
#include "motors.h" |
|
2 |
|
|
3 |
void motors_init(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void motor1_set(int direction, int speed) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
void motor2_set(int direction, int speed) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
void motors_off(void) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
branches/simulator/projects/simulator/libsim/orbs.c | ||
---|---|---|
1 |
#include "lights.h" |
|
2 |
|
|
3 |
void orb_init(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void orb_set(unsigned char red_led, unsigned char green_led, |
|
9 |
unsigned char blue_led) |
|
10 |
{ |
|
11 |
|
|
12 |
} |
|
13 |
|
|
14 |
void orb1_set(unsigned char red_led, unsigned char green_led, |
|
15 |
unsigned char blue_led) |
|
16 |
{ |
|
17 |
|
|
18 |
} |
|
19 |
|
|
20 |
void orb2_set(unsigned char red_led, unsigned char green_led, |
|
21 |
unsigned char blue_led) |
|
22 |
{ |
|
23 |
|
|
24 |
} |
|
25 |
|
|
26 |
void orb_set_color(int col) |
|
27 |
{ |
|
28 |
|
|
29 |
} |
|
30 |
|
|
31 |
void orb1_set_color(int col) |
|
32 |
{ |
|
33 |
|
|
34 |
} |
|
35 |
|
|
36 |
void orb2_set_color(int col) |
|
37 |
{ |
|
38 |
|
|
39 |
} |
|
40 |
|
|
41 |
void orb_disable(void) |
|
42 |
{ |
|
43 |
|
|
44 |
} |
|
45 |
|
|
46 |
void orb_enable(void) |
|
47 |
{ |
|
48 |
|
|
49 |
} |
|
50 |
|
branches/simulator/projects/simulator/libsim/eeprom.c | ||
---|---|---|
1 |
#include "eeprom.h" |
|
2 |
|
|
3 |
int eeprom_put_byte(unsigned int addr, unsigned char byte) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
int eeprom_get_byte(unsigned int addr, unsigned char *byte) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
unsigned char get_robotid(void) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
branches/simulator/projects/simulator/libsim/battery.c | ||
---|---|---|
1 |
#include "batter.h" |
|
2 |
|
|
3 |
int battery8(void) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
int battery(void) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
char battery_low(void) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
int battery8_avg(int n_samples) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
branches/simulator/projects/simulator/libsim/dio.c | ||
---|---|---|
1 |
#include "dio.h" |
|
2 |
|
|
3 |
int digital_input(int port) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void digital_output(int port, int val) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
void digital_pull_up(int port) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
int button1_read(void) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
int button1_click(void) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
|
28 |
void button1_wait(void) |
|
29 |
{ |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
int button2_read(void) |
|
34 |
{ |
|
35 |
|
|
36 |
} |
|
37 |
|
|
38 |
int button2_click(void) |
|
39 |
{ |
|
40 |
|
|
41 |
} |
|
42 |
|
|
43 |
void button2_wait(void) |
|
44 |
{ |
|
45 |
|
|
46 |
} |
|
47 |
|
branches/simulator/projects/simulator/libsim/Makefile | ||
---|---|---|
1 |
SRC = libsim.c |
|
2 |
OBJ = $(SRC:.c=.o)) |
|
3 |
|
|
4 |
CC = gcc |
|
5 |
CFLAGS = -Wall -O0 |
|
6 |
AR = ar |
|
7 |
LDFLAGS = |
|
8 |
|
|
9 |
TARGET = libsim |
|
10 |
|
|
11 |
all: $(OBJ) |
|
12 |
$(AR) rcs $(TARGET).a $(OBJ) |
|
13 |
|
|
14 |
%.o: %.c |
|
15 |
$(CC) -c $(CFLAGS) $< -o $@ |
branches/simulator/projects/simulator/libsim/bom.c | ||
---|---|---|
1 |
#include "bom.h" |
|
2 |
|
|
3 |
void bom_init(char type) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
void bom_refresh(int bitfield) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
int bom_get(int which) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
int bom_get_max(void) |
|
19 |
{ |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
void bom_leds_on(int bit_field) |
|
24 |
{ |
|
25 |
|
|
26 |
} |
|
27 |
|
|
28 |
void bom_leds_off(int bit_field) |
|
29 |
{ |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
void bom_on(void) |
|
34 |
{ |
|
35 |
|
|
36 |
} |
|
37 |
|
|
38 |
void bom_off(void) |
|
39 |
{ |
|
40 |
|
|
41 |
} |
|
42 |
|
branches/simulator/projects/simulator/libsim/i2c.c | ||
---|---|---|
1 |
#include "i2c.h" |
|
2 |
|
|
3 |
int i2c_init(char addr, fun_mrecv_t master_recv, fun_srecv_t slave_recv, fun_send_t slave_send) |
|
4 |
{ |
|
5 |
|
|
6 |
} |
|
7 |
|
|
8 |
int i2c_send(char dest, char* data, size_t bytes) |
|
9 |
{ |
|
10 |
|
|
11 |
} |
|
12 |
|
|
13 |
int i2c_request(char dest) |
|
14 |
{ |
|
15 |
|
|
16 |
} |
|
17 |
|
branches/simulator/projects/libdragonfly/Makefile | ||
---|---|---|
162 | 162 |
|
163 | 163 |
publish: |
164 | 164 |
$(COPY) $(TARGET).a $(COLONYROOT)/code/lib/bin |
165 |
$(COPY) *.h $(COLONYROOT)/code/lib/include/$(TARGET) |
|
165 |
$(COPY) include/*.h $(COLONYROOT)/code/lib/include/$(TARGET)
|
|
166 | 166 |
|
167 | 167 |
docs: |
168 | 168 |
$(DOXYGEN) |
Also available in: Unified diff