X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Ftelefireeight-v1.0%2Fao_pins.h;h=c15e06bf1e4adf70167cf06315b09443f443d1c9;hp=8e3529e73e3270322bf4ca6c5ee1bb077e095bcd;hb=dbc52686c6d9808275c35e0c9c987cbbd9f7859d;hpb=14fa6cee857918966740d05c4ed13b1a79db3caa;ds=sidebyside diff --git a/src/telefireeight-v1.0/ao_pins.h b/src/telefireeight-v1.0/ao_pins.h index 8e3529e7..c15e06bf 100644 --- a/src/telefireeight-v1.0/ao_pins.h +++ b/src/telefireeight-v1.0/ao_pins.h @@ -25,6 +25,10 @@ #define HAS_FLIGHT 0 #define HAS_USB 1 #define HAS_BEEP 0 +#define BEEPER_TIMER 3 +#define BEEPER_CHANNEL 1 +#define BEEPER_PORT (&stm_gpioc) +#define BEEPER_PIN 6 #define HAS_GPS 0 #define HAS_SERIAL_1 0 #define HAS_ADC 1 @@ -107,7 +111,7 @@ #define AO_CC1200_INT_GPIO 2 #define AO_CC1200_INT_GPIO_IOCFG CC1200_IOCFG2 -#define LED_PER_LED 1 +#define HAS_LED 1 #define LED_TYPE uint16_t /* Continuity leds 1-8 */ @@ -128,14 +132,8 @@ #define LED_7_PORT (&stm_gpioa) #define LED_7_PIN 10 -#define LED_PIN_CONTINUITY_0 0 -#define LED_PIN_CONTINUITY_1 1 -#define LED_PIN_CONTINUITY_2 2 -#define LED_PIN_CONTINUITY_3 3 -#define LED_PIN_CONTINUITY_4 4 -#define LED_PIN_CONTINUITY_5 5 -#define LED_PIN_CONTINUITY_6 6 -#define LED_PIN_CONTINUITY_7 7 +#define AO_LED_CONTINUITY(c) (1 << (c)) +#define AO_LED_CONTINUITY_MASK (0xff) /* ARM */ #define LED_8_PORT (&stm_gpioe) @@ -151,19 +149,10 @@ #define LED_11_PORT (&stm_gpioe) #define LED_11_PIN 6 -#define LED_PIN_GREEN 9 -#define LED_PIN_AMBER 10 -#define LED_PIN_RED 11 - -#define AO_LED_CONTINUITY(c) (1 << (c)) -#define AO_LED_CONTINUITY_MASK (0xff) - -#define AO_LED_ARMED (1 << LED_PIN_ARMED) -#define AO_LED_GREEN (1 << LED_PIN_GREEN) -#define AO_LED_AMBER (1 << LED_PIN_AMBER) -#define AO_LED_RED (1 << LED_PIN_RED) - -#define LEDS_AVAILABLE (0xfff) +#define AO_LED_ARMED AO_LED_8 +#define AO_LED_GREEN AO_LED_9 +#define AO_LED_AMBER AO_LED_10 +#define AO_LED_RED AO_LED_11 /* Alarm A */ #define AO_SIREN @@ -189,35 +178,89 @@ #define AO_PAD_PIN_0 9 #define AO_PAD_0_PORT (&stm_gpiod) -#define AO_PAD_ADC_0 3 +#define AO_ADC_SENSE_PAD_0 3 +#define AO_ADC_SENSE_PAD_0_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_0_PIN 3 #define AO_PAD_PIN_1 8 #define AO_PAD_1_PORT (&stm_gpiod) -#define AO_PAD_ADC_1 2 +#define AO_ADC_SENSE_PAD_1 2 +#define AO_ADC_SENSE_PAD_1_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_1_PIN 2 #define AO_PAD_PIN_2 15 #define AO_PAD_2_PORT (&stm_gpiob) -#define AO_PAD_ADC_2 1 +#define AO_ADC_SENSE_PAD_2 1 +#define AO_ADC_SENSE_PAD_2_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_2_PIN 1 #define AO_PAD_PIN_3 14 #define AO_PAD_3_PORT (&stm_gpiob) -#define AO_PAD_ADC_3 0 +#define AO_ADC_SENSE_PAD_3 0 +#define AO_ADC_SENSE_PAD_3_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_3_PIN 0 #define AO_PAD_PIN_4 12 #define AO_PAD_4_PORT (&stm_gpiod) -#define AO_PAD_ADC_4 7 +#define AO_ADC_SENSE_PAD_4 7 +#define AO_ADC_SENSE_PAD_4_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_4_PIN 7 #define AO_PAD_PIN_5 13 #define AO_PAD_5_PORT (&stm_gpiod) -#define AO_PAD_ADC_5 6 +#define AO_ADC_SENSE_PAD_5 6 +#define AO_ADC_SENSE_PAD_5_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_5_PIN 6 #define AO_PAD_PIN_6 14 #define AO_PAD_6_PORT (&stm_gpiod) -#define AO_PAD_ADC_6 5 +#define AO_ADC_SENSE_PAD_6 5 +#define AO_ADC_SENSE_PAD_6_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_6_PIN 5 #define AO_PAD_PIN_7 15 #define AO_PAD_7_PORT (&stm_gpiod) -#define AO_PAD_ADC_7 4 +#define AO_ADC_SENSE_PAD_7 4 +#define AO_ADC_SENSE_PAD_7_PORT (&stm_gpioa) +#define AO_ADC_SENSE_PAD_7_PIN 4 + +#define AO_ADC_PYRO 8 +#define AO_ADC_PYRO_PORT (&stm_gpiob) +#define AO_ADC_PYRO_PIN 0 + +#define AO_ADC_BATT 15 +#define AO_ADC_BATT_PORT (&stm_gpioc) +#define AO_ADC_BATT_PIN 5 + +#define AO_ADC_PIN0_PORT AO_ADC_SENSE_PAD_0_PORT +#define AO_ADC_PIN0_PIN AO_ADC_SENSE_PAD_0_PIN + +#define AO_ADC_PIN1_PORT AO_ADC_SENSE_PAD_1_PORT +#define AO_ADC_PIN1_PIN AO_ADC_SENSE_PAD_1_PIN + +#define AO_ADC_PIN2_PORT AO_ADC_SENSE_PAD_2_PORT +#define AO_ADC_PIN2_PIN AO_ADC_SENSE_PAD_2_PIN + +#define AO_ADC_PIN3_PORT AO_ADC_SENSE_PAD_3_PORT +#define AO_ADC_PIN3_PIN AO_ADC_SENSE_PAD_3_PIN + +#define AO_ADC_PIN4_PORT AO_ADC_SENSE_PAD_4_PORT +#define AO_ADC_PIN4_PIN AO_ADC_SENSE_PAD_4_PIN + +#define AO_ADC_PIN5_PORT AO_ADC_SENSE_PAD_5_PORT +#define AO_ADC_PIN5_PIN AO_ADC_SENSE_PAD_5_PIN + +#define AO_ADC_PIN6_PORT AO_ADC_SENSE_PAD_6_PORT +#define AO_ADC_PIN6_PIN AO_ADC_SENSE_PAD_6_PIN + +#define AO_ADC_PIN7_PORT AO_ADC_SENSE_PAD_7_PORT +#define AO_ADC_PIN7_PIN AO_ADC_SENSE_PAD_7_PIN + +#define AO_ADC_PIN8_PORT AO_ADC_PYRO_PORT +#define AO_ADC_PIN8_PIN AO_ADC_PYRO_PIN + +#define AO_ADC_PIN9_PORT AO_ADC_BATT_PORT +#define AO_ADC_PIN9_PIN AO_ADC_BATT_PIN #define AO_PAD_ALL_CHANNELS (0xff) @@ -226,30 +269,38 @@ #define AO_PAD_NO_IGNITER 16904 #define AO_PAD_GOOD_IGNITER 22514 -#define AO_PAD_ADC_PYRO 8 -#define AO_PAD_ADC_BATT 15 - #define AO_ADC_FIRST_PIN 0 #define AO_NUM_ADC 10 -#define AO_ADC_SQ1 AO_PAD_ADC_0 -#define AO_ADC_SQ2 AO_PAD_ADC_1 -#define AO_ADC_SQ3 AO_PAD_ADC_2 -#define AO_ADC_SQ4 AO_PAD_ADC_3 -#define AO_ADC_SQ5 AO_PAD_ADC_4 -#define AO_ADC_SQ6 AO_PAD_ADC_5 -#define AO_ADC_SQ7 AO_PAD_ADC_6 -#define AO_ADC_SQ8 AO_PAD_ADC_7 -#define AO_ADC_SQ9 AO_PAD_ADC_PYRO -#define AO_ADC_SQ10 AO_PAD_ADC_BATT +#define AO_ADC_SQ1 AO_ADC_SENSE_PAD_0 +#define AO_ADC_SQ2 AO_ADC_SENSE_PAD_1 +#define AO_ADC_SQ3 AO_ADC_SENSE_PAD_2 +#define AO_ADC_SQ4 AO_ADC_SENSE_PAD_3 +#define AO_ADC_SQ5 AO_ADC_SENSE_PAD_4 +#define AO_ADC_SQ6 AO_ADC_SENSE_PAD_5 +#define AO_ADC_SQ7 AO_ADC_SENSE_PAD_6 +#define AO_ADC_SQ8 AO_ADC_SENSE_PAD_7 +#define AO_ADC_SQ9 AO_ADC_PYRO +#define AO_ADC_SQ10 AO_ADC_BATT + +#define AO_ADC_REFERENCE_DV 33 + +#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOAEN) | \ + (1 << STM_RCC_AHBENR_GPIOBEN) | \ + (1 << STM_RCC_AHBENR_GPIOCEN)) -#define AO_PYRO_R_PYRO_SENSE 200 -#define AO_PYRO_R_SENSE_GND 22 -#define AO_FIRE_R_POWER_FET 0 -#define AO_FIRE_R_FET_SENSE 200 -#define AO_FIRE_R_SENSE_GND 22 +#define AO_PAD_R_V_BATT_BATT_SENSE 200 +#define AO_PAD_R_BATT_SENSE_GND 22 + +#define AO_PAD_R_V_BATT_V_PYRO 200 +#define AO_PAD_R_V_PYRO_PYRO_SENSE 200 +#define AO_PAD_R_PYRO_SENSE_GND 22 + +#undef AO_PAD_R_V_PYRO_IGNITER +#define AO_PAD_R_IGNITER_IGNITER_SENSE 200 +#define AO_PAD_R_IGNITER_SENSE_GND 22 #define HAS_ADC_TEMP 0 @@ -276,15 +327,4 @@ struct ao_adc { (p)->adc.pyro, \ (p)->adc.batt) -#define AO_ADC_PINS ((1 << AO_PAD_ADC_0) | \ - (1 << AO_PAD_ADC_1) | \ - (1 << AO_PAD_ADC_2) | \ - (1 << AO_PAD_ADC_3) | \ - (1 << AO_PAD_ADC_4) | \ - (1 << AO_PAD_ADC_5) | \ - (1 << AO_PAD_ADC_6) | \ - (1 << AO_PAD_ADC_7) | \ - (1 << AO_PAD_ADC_PYRO) | \ - (1 << AO_PAD_ADC_BATT)) - #endif /* _AO_PINS_H_ */