X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Feasymega-v1.0%2Fao_pins.h;h=da0102077aefbd996049dd06b70081b893decdff;hb=d6bdabbdfa0cd3854e67fd363dc1bb4bd14e68d9;hp=0b6c0f0700813d1dfe5eab91ca6469d51afce89e;hpb=ca0bf9fb2d6323d7a454e5ce04b48d11366eee67;p=fw%2Faltos diff --git a/src/easymega-v1.0/ao_pins.h b/src/easymega-v1.0/ao_pins.h index 0b6c0f07..da010207 100644 --- a/src/easymega-v1.0/ao_pins.h +++ b/src/easymega-v1.0/ao_pins.h @@ -1,9 +1,10 @@ /* - * Copyright © 2012 Keith Packard + * Copyright © 2014 Bdale Garbee * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,7 +19,6 @@ #ifndef _AO_PINS_H_ #define _AO_PINS_H_ -#define HAS_TASK_QUEUE 1 /* 8MHz High speed external crystal */ #define AO_HSE 8000000 @@ -46,7 +46,7 @@ #define HAS_SERIAL_1 0 #define USE_SERIAL_1_STDIN 0 #define SERIAL_1_PB6_PB7 0 -#define SERIAL_1_PA9_PA10 1 +#define SERIAL_1_PA9_PA10 0 #define HAS_SERIAL_2 0 #define USE_SERIAL_2_STDIN 0 @@ -56,19 +56,35 @@ #define HAS_SERIAL_3 0 #define USE_SERIAL_3_STDIN 0 #define SERIAL_3_PB10_PB11 0 -#define SERIAL_3_PC10_PC11 1 +#define SERIAL_3_PC10_PC11 0 #define SERIAL_3_PD8_PD9 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_stm_usart1.rx_fifo) + #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX (1024 * 1024) +#define AO_CONFIG_MAX_SIZE 1024 +#define LOG_ERASE_MARK 0x55 +#define LOG_MAX_ERASE 128 +#define AO_LOG_FORMAT AO_LOG_FORMAT_TELEMEGA + #define HAS_EEPROM 1 #define USE_INTERNAL_FLASH 0 #define USE_EEPROM_CONFIG 1 #define USE_STORAGE_CONFIG 0 #define HAS_USB 1 #define HAS_BEEP 1 +#define BEEPER_TIMER 3 +#define BEEPER_CHANNEL 1 +#define BEEPER_PORT (&stm_gpioc) +#define BEEPER_PIN 6 +#define HAS_BATTERY_REPORT 1 #define HAS_RADIO 0 #define HAS_TELEMETRY 0 #define HAS_APRS 0 +#define HAS_COMPANION 1 #define HAS_SPI_1 1 #define SPI_1_PA5_PA6_PA7 1 /* Barometer */ @@ -81,12 +97,10 @@ #define SPI_2_PD1_PD3_PD4 0 #define SPI_2_OSPEEDR STM_OSPEEDR_10MHz -#if 0 #define SPI_2_PORT (&stm_gpiob) #define SPI_2_SCK_PIN 13 #define SPI_2_MISO_PIN 14 #define SPI_2_MOSI_PIN 15 -#endif #define HAS_I2C_1 1 #define I2C_1_PB8_PB9 1 @@ -99,7 +113,7 @@ #define LOW_LEVEL_DEBUG 0 -#define LED_PORT_ENABLE STM_RCC_AHBENR_GPIOCEN +#define LED_PORT_ENABLE STM_RCC_AHBENR_GPIOAEN #define LED_PORT (&stm_gpioa) #define LED_PIN_RED 9 #define LED_PIN_GREEN 10 @@ -154,9 +168,6 @@ /* Number of general purpose pyro channels available */ #define AO_PYRO_NUM 4 -#define AO_IGNITER_SET_DROGUE(v) stm_gpio_set(AO_IGNITER_DROGUE_PORT, AO_IGNITER_DROGUE_PIN, v) -#define AO_IGNITER_SET_MAIN(v) stm_gpio_set(AO_IGNITER_MAIN_PORT, AO_IGNITER_MAIN_PIN, v) - /* * ADC */ @@ -171,7 +182,7 @@ struct ao_adc { }; #define AO_ADC_DUMP(p) \ - printf("tick: %5u A: %5d B: %5d C: %5d D: %5d drogue: %5d main: %5d batt: %5d pbatt: %5d temp: %5d\n", \ + printf("tick: %5lu A: %5d B: %5d C: %5d D: %5d drogue: %5d main: %5d batt: %5d pbatt: %5d temp: %5d\n", \ (p)->tick, \ (p)->adc.sense[0], (p)->adc.sense[1], (p)->adc.sense[2], \ (p)->adc.sense[3], (p)->adc.sense[4], (p)->adc.sense[5], \ @@ -199,7 +210,7 @@ struct ao_adc { #define AO_ADC_SENSE_MAIN 10 #define AO_ADC_SENSE_MAIN_PORT (&stm_gpioc) -#define AO_ADC_SENSE_MAIN_PIN 0 +#define AO_ADC_SENSE_MAIN_PIN 0 #define AO_ADC_V_BATT 8 #define AO_ADC_V_BATT_PORT (&stm_gpiob) @@ -211,7 +222,8 @@ struct ao_adc { #define AO_ADC_TEMP 16 -#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOEEN) | \ +#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOAEN) | \ + (1 << STM_RCC_AHBENR_GPIOEEN) | \ (1 << STM_RCC_AHBENR_GPIOBEN)) #define AO_NUM_ADC_PIN (AO_ADC_NUM_SENSE + 2) @@ -251,6 +263,12 @@ struct ao_adc { #define AO_BATTERY_DIV_PLUS 56 /* 5.6k */ #define AO_BATTERY_DIV_MINUS 100 /* 10k */ +/* + * Voltage divider on ADC pyro battery sampler + */ +#define AO_PYRO_BATTERY_DIV_PLUS 100 /* 100k */ +#define AO_PYRO_BATTERY_DIV_MINUS 27 /* 27k */ + /* * Voltage divider on ADC igniter samplers */ @@ -270,10 +288,10 @@ struct ao_adc { #define AO_MS5607_PRIVATE_PINS 1 #define AO_MS5607_CS_PORT (&stm_gpioa) #define AO_MS5607_CS_PIN 3 -#define AO_MS5607_CS_MASK (1 << AO_MS5607_CS) +#define AO_MS5607_CS_MASK (1 << AO_MS5607_CS_PIN) #define AO_MS5607_MISO_PORT (&stm_gpioa) #define AO_MS5607_MISO_PIN 6 -#define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO) +#define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO_PIN) #define AO_MS5607_SPI_INDEX AO_SPI_1_PA5_PA6_PA7 /* @@ -282,7 +300,8 @@ struct ao_adc { #define M25_MAX_CHIPS 1 #define AO_M25_SPI_CS_PORT (&stm_gpiob) -#define AO_M25_SPI_CS_MASK (1 << 12) +#define AO_M25_SPI_CS_PIN 12 +#define AO_M25_SPI_CS_MASK (1 << AO_M25_SPI_CS_PIN) #define AO_M25_SPI_BUS AO_SPI_2_PB13_PB14_PB15 /* @@ -311,6 +330,7 @@ struct ao_adc { */ #define HAS_MMA655X 1 +#define AO_MMA655X_INVERT 0 #define AO_MMA655X_SPI_INDEX AO_SPI_1_PB3_PB4_PB5 #define AO_MMA655X_CS_PORT (&stm_gpioc) #define AO_MMA655X_CS_PIN 12