X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftelegps-v2.0%2Fao_pins.h;h=74f4ff27d6ea46f8823e8a997a2df898847b8be2;hb=99c5c47d9288721a1fe009698393c67dd36a16fb;hp=c51f0afb61450e61e8712a5b3334d77526fc5722;hpb=f69d85e2b32370ab68e2725e739417cad6d7a590;p=fw%2Faltos diff --git a/src/telegps-v2.0/ao_pins.h b/src/telegps-v2.0/ao_pins.h index c51f0afb..74f4ff27 100644 --- a/src/telegps-v2.0/ao_pins.h +++ b/src/telegps-v2.0/ao_pins.h @@ -21,18 +21,23 @@ #define LED_PORT_ENABLE STM_RCC_AHBENR_IOPBEN #define LED_PORT (&stm_gpiob) -#define LED_PIN_RED 5 -#define AO_LED_RED (1 << LED_PIN_RED) +#define LED_PIN_GREEN 5 +#define AO_LED_GREEN (1 << LED_PIN_GREEN) +#define AO_LED_PANIC AO_LED_GREEN +#define AO_LED_GPS_LOCK AO_LED_GREEN -#define LEDS_AVAILABLE (AO_LED_RED) +#define LEDS_AVAILABLE (AO_LED_GREEN) + +#define AO_STACK_SIZE 512 #define IS_FLASH_LOADER 0 #define HAS_BEEP 0 #define AO_HSE 32000000 #define AO_RCC_CFGR_PLLMUL STM_RCC_CFGR_PLLMUL_3 +#define AO_RCC_CFGR2_PLLDIV STM_RCC_CFGR2_PREDIV_2 #define AO_PLLMUL 3 -#define AO_PLLDIV 1 +#define AO_PLLDIV 2 /* HCLK = 48MHz */ #define AO_AHB_PRESCALER 1 @@ -42,8 +47,6 @@ #define AO_APB_PRESCALER 1 #define AO_RCC_CFGR_PPRE_DIV STM_RCC_CFGR_PPRE_DIV_1 -#define AO_RCC_CFGR2_PLLDIV STM_RCC_CFGR2_PREDIV_1 - #define HAS_USB 1 #define AO_USB_DIRECTIO 0 #define AO_PA11_PA12_RMP 1 @@ -53,11 +56,13 @@ /* ADC */ #define HAS_ADC 1 -#define AO_ADC_PIN0_PORT (&stm_gpioa) -#define AO_ADC_PIN0_PIN 0 -#define AO_ADC_PIN0_CH 0 +#define AO_ADC_PIN0_PORT (&stm_gpiob) +#define AO_ADC_PIN0_PIN 1 +#define AO_ADC_PIN0_CH 9 + +#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_IOPBEN)) -#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_IOPAEN)) +#define ao_telemetry_battery_convert(a) ((a) << 3) #define AO_NUM_ADC 1 @@ -90,8 +95,6 @@ struct ao_adc { #define SPI_1_PB3_PB4_PB5 0 #define SPI_1_OSPEEDR STM_OSPEEDR_HIGH -#define HAS_MS5607 0 - /* Flash */ #define M25_MAX_CHIPS 1 @@ -99,14 +102,18 @@ struct ao_adc { #define AO_M25_SPI_CS_MASK (1 << 0) #define AO_M25_SPI_BUS AO_SPI_1_PA5_PA6_PA7 +/* Serial */ #define HAS_SERIAL_1 1 #define SERIAL_1_PB6_PB7 1 #define USE_SERIAL_1_STDIN 0 -#define ao_gps_getchar ao_serial1_getchar -#define ao_gps_putchar ao_serial1_putchar -#define ao_gps_set_speed ao_serial1_set_speed -#define ao_gps_fifo (ao_usart_rx_fifo) +#define HAS_SERIAL_2 1 +#define SERIAL_2_PA2_PA3 1 +#define USE_SERIAL_2_STDIN 0 + +#define ao_gps_getchar ao_serial2_getchar +#define ao_gps_putchar ao_serial2_putchar +#define ao_gps_set_speed ao_serial2_set_speed #define HAS_EEPROM 1 #define USE_INTERNAL_FLASH 0 @@ -114,7 +121,6 @@ struct ao_adc { #define HAS_TELEMETRY 1 #define HAS_RDF 1 #define HAS_APRS 1 -#define HAS_RADIO_RECV 0 #define HAS_GPS 1 #define HAS_FLIGHT 0 @@ -146,7 +152,7 @@ struct ao_adc { #define AO_CC1200_SPI_CS_PIN 5 #define AO_CC1200_SPI_BUS AO_SPI_1_PA5_PA6_PA7 #define AO_CC1200_SPI stm_spi1 -#define AO_CC1200_SPI_SPEED AO_SPI_SPEED_FAST +#define AO_CC1200_SPI_SPEED AO_SPI_SPEED_6MHz #define AO_CC1200_INT_PORT (&stm_gpioa) #define AO_CC1200_INT_PIN 4