From bd43955ff0c4d39a685b79e91cb62898a5f1b875 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 Mar 2013 01:14:15 -0700 Subject: [PATCH] altos: Hook up the FAT16 and SD card support to telegps Signed-off-by: Keith Packard --- src/telegps-v0.1/Makefile | 10 ++++++++- src/telegps-v0.1/ao_pins.h | 38 ++++++++++++++++++++++++++++------- src/telegps-v0.1/ao_telegps.c | 6 ++++++ 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/telegps-v0.1/Makefile b/src/telegps-v0.1/Makefile index 26d9eaa0..c8ab8a9a 100644 --- a/src/telegps-v0.1/Makefile +++ b/src/telegps-v0.1/Makefile @@ -14,6 +14,7 @@ INC = \ ao_task.h \ ao_whiten.h \ ao_cc115l.h \ + ao_rf_cc115l.h \ ao_fec.h \ stm32l.h \ Makefile @@ -48,7 +49,14 @@ ALTOS_SRC = \ ao_serial_stm.c \ ao_gps_skytraq.c \ ao_cc115l.c \ - ao_fec_tx.c + ao_fec_tx.c \ + ao_rfpa0133.c \ + ao_aprs.c \ + ao_storage.c \ + ao_eeprom_stm.c \ + ao_sdcard.c \ + ao_bufio.c \ + ao_fat.c PRODUCT=TeleGPS-v0.1 PRODUCT_DEF=-DTELEGPS diff --git a/src/telegps-v0.1/ao_pins.h b/src/telegps-v0.1/ao_pins.h index 46d0b9f2..01f4a303 100644 --- a/src/telegps-v0.1/ao_pins.h +++ b/src/telegps-v0.1/ao_pins.h @@ -64,17 +64,20 @@ #define ao_gps_set_speed ao_serial2_set_speed #define ao_gps_fifo (ao_stm_usart2.rx_fifo) -#define HAS_EEPROM 0 -#define USE_INTERNAL_FLASH 0 +#define HAS_EEPROM 1 +#define USE_INTERNAL_FLASH 1 #define HAS_USB 1 #define HAS_BEEP 0 -#define HAS_RADIO 0 -#define HAS_TELEMETRY 0 +#define HAS_RADIO 1 +#define HAS_TELEMETRY 1 +#define HAS_APRS 1 +#define HAS_RADIO_RECV 0 -#define HAS_SPI_1 0 -#define SPI_1_PA5_PA6_PA7 0 +#define HAS_SPI_1 1 +#define SPI_1_PA5_PA6_PA7 1 /* SD card */ #define SPI_1_PB3_PB4_PB5 0 #define SPI_1_PE13_PE14_PE15 0 +#define SPI_1_OSPEEDR STM_OSPEEDR_10MHz #define HAS_SPI_2 1 #define SPI_2_PB13_PB14_PB15 1 /* CC115L */ @@ -108,7 +111,7 @@ #define LEDS_AVAILABLE (AO_LED_RED | AO_LED_GREEN) -#define HAS_GPS 0 +#define HAS_GPS 1 #define HAS_FLIGHT 0 #define HAS_ADC 0 #define HAS_LOG 0 @@ -147,5 +150,26 @@ #define AO_CC115L_MARC_GPIO 0 #define AO_CC115L_MARC_GPIO_IOCFG CC115L_IOCFG0 +#define AO_RADIO_HAS_PA 1 + +/* + * Power amplifier (RFPA0133) + */ + +#define AO_PA_POWER_GPIO (&stm_gpiob) +#define AO_PA_POWER_PIN 1 +#define AO_PA_GAIN_8_GPIO (&stm_gpiob) +#define AO_PA_GAIN_8_PIN 10 +#define AO_PA_GAIN_16_GPIO (&stm_gpiob) +#define AO_PA_GAIN_16_PIN 11 + +/* + * SD card + */ + +#define AO_SDCARD_SPI_BUS AO_SPI_1_PA5_PA6_PA7 +#define AO_SDCARD_SPI_CS_PORT (&stm_gpioa) +#define AO_SDCARD_SPI_CS_PIN 4 +#define AO_SDCARD_SPI stm_spi1 #endif /* _AO_PINS_H_ */ diff --git a/src/telegps-v0.1/ao_telegps.c b/src/telegps-v0.1/ao_telegps.c index fdf365e3..2f1f38f2 100644 --- a/src/telegps-v0.1/ao_telegps.c +++ b/src/telegps-v0.1/ao_telegps.c @@ -17,6 +17,7 @@ #include #include +#include int main(void) @@ -32,10 +33,13 @@ main(void) // ao_led_on(AO_LED_RED); ao_timer_init(); + ao_spi_init(); ao_dma_init(); ao_exti_init(); + ao_storage_init(); + ao_serial_init(); ao_cmd_init(); @@ -45,6 +49,8 @@ main(void) ao_gps_init(); + ao_fat_init(); + ao_config_init(); ao_start_scheduler(); -- 2.30.2