int serial;
char name[256];
char path[256];
+ int (*method_1)(int x, int y);
//%mutable;
};
%{
#include "libaltos.h"
%}
-
+%extend altos_device {
+ int method_1(int x, int y) {
+ return ($self->method_1)(x, y);
+ }
+}
#
#
-include ../stmf0/Makefile.defs
+TOPDIR=..
+
+include $(TOPDIR)/stmf0/Makefile.defs
INC = \
ao.h \
ao_pins.h \
ao_product.h \
ao_task.h \
- ao_lisp.h \
- ao_lisp_const.h \
stm32f0.h \
Makefile
ao_romconfig.c \
ao_cmd.c \
ao_config.c \
+ ao_data.c \
ao_task.c \
ao_led_stmf0.c \
- ao_beep_stm.c \
ao_dma_stm.c \
ao_stdio.c \
ao_panic.c \
ao_timer.c \
ao_mutex.c \
ao_usb_stm.c \
- ao_serial_stm.c \
ao_flash_stm.c \
- ao_lisp_atom.c \
- ao_lisp_builtin.c \
- ao_lisp_cons.c \
- ao_lisp_error.c \
- ao_lisp_eval.c \
- ao_lisp_frame.c \
- ao_lisp_int.c \
- ao_lisp_lambda.c \
- ao_lisp_lex.c \
- ao_lisp_mem.c \
- ao_lisp_poly.c \
- ao_lisp_read.c \
- ao_lisp_rep.c \
- ao_lisp_save.c \
- ao_lisp_stack.c \
- ao_lisp_string.c \
- ao_lisp_os_save.c
+ ao_spi_stm.c \
+ ao_bmi088.c
PRODUCT=Nucleo-32
PRODUCT_DEF=-DNUCLEO
IDPRODUCT=0x000a
-CFLAGS = $(PRODUCT_DEF) $(STMF0_CFLAGS)
-
-LDFLAGS=$(CFLAGS) -L$(TOPDIR)/stmf0 -Wl,-Tload.ld -n
+CFLAGS = $(PRODUCT_DEF) $(STMF0_CFLAGS) $(PROFILE_DEF)
PROGNAME=nucleo-32
PROG=$(PROGNAME)-$(VERSION).elf
all: $(PROG) $(HEX)
$(PROG): Makefile $(OBJ) altos.ld
- $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
+ $(call quiet,CC) $(LDFLAGS) -o $(PROG) $(OBJ) $(LIBS) -Wl,-Map=$(PROGNAME)-$(VERSION).map
$(OBJ): $(INC)
-ao_product.h: ao-make-product.5c ../Version
- $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
-
-load: $(PROG)
- stm-load $(PROG)
-
distclean: clean
clean:
- rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx
+ rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx $(PROGNAME)-*.map
rm -f ao_product.h
install:
*/
#include <ao.h>
-#include <ao_lisp.h>
-#include <ao_beep.h>
+#include <ao_bmi088.h>
-static void lisp_cmd() {
- ao_lisp_read_eval_print();
-}
-
-static void beep() {
- ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(200));
-}
-
-static const struct ao_cmds blink_cmds[] = {
- { lisp_cmd, "l\0Run lisp interpreter" },
- { beep, "b\0Beep" },
- { 0, 0 }
-};
+uint8_t ao_sensor_errors;
-void main(void)
+int main(void)
{
- ao_led_init(LEDS_AVAILABLE);
+ ao_led_init();
ao_clock_init();
ao_task_init();
ao_timer_init();
ao_dma_init();
ao_usb_init();
- ao_serial_init();
- ao_beep_init();
+ ao_spi_init();
+ ao_bmi088_init();
ao_cmd_init();
- ao_cmd_register(blink_cmds);
ao_start_scheduler();
}
#define HAS_USB 1
#define AO_USB_DIRECTIO 0
#define AO_PA11_PA12_RMP 0
-#define HAS_BEEP 1
-
-#define BEEPER_TIMER 2
-#define BEEPER_CHANNEL 4
-#define BEEPER_PORT (&stm_gpioa)
-#define BEEPER_PIN 3
+#define HAS_BEEP 0
#define IS_FLASH_LOADER 0
-#define HAS_SERIAL_2 1
+#define HAS_SERIAL_2 0
#define SERIAL_2_PA2_PA15 1
#define USE_SERIAL_2_FLOW 0
#define USE_SERIAL_2_STDIN 1
#define DELAY_SERIAL_2_STDIN 0
+#define HAS_SPI_1 1
+#define SPI_1_PA5_PA6_PA7 1
+#define SPI_1_OSPEEDR STM_OSPEEDR_HIGH
+#define SPI_1_PB3_PB4_PB5 0
+
+#define HAS_SPI_2 0
+
+#define HAS_BMI088 1
+#define HAS_IMU 1
+
+#define ao_data_along(packet) ((packet)->bmi088.acc.x)
+#define ao_data_across(packet) (-(packet)->bmi088.acc.y)
+#define ao_data_through(packet) ((packet)->bmi088.acc.z)
+
+#define ao_data_roll(packet) ((packet)->bmi088.gyr.x)
+#define ao_data_pitch(packet) (-(packet)->bmi088.gyr.y)
+#define ao_data_yaw(packet) ((packet)->bmi088.gyr.z)
+
+#define AO_BMI088_ACC_CS_PORT (&stm_gpioa)
+#define AO_BMI088_ACC_CS_PIN 0
+#define AO_BMI088_GYR_CS_PORT (&stm_gpioa)
+#define AO_BMI088_GYR_CS_PIN 1
+#define AO_BMI088_SPI_BUS (AO_SPI_1_PA5_PA6_PA7 | AO_SPI_MODE_0)
+
+#define AO_DATA_RING 32
+
#endif /* _AO_PINS_H_ */