altosui: Add config and pyro tabs to graph widget
[fw/altos] / src / easymini-v1.0 / ao_pins.h
index e721030d84201311706cdee0a99364bdf1f661c4..940d0d98c26a7ac62e292a3c4b262a9a78fb5862 100644 (file)
@@ -3,7 +3,8 @@
  *
  * 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
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-#define HAS_BEEP       1
-#define        HAS_LED         0
+#define HAS_BEEP               1
+#define HAS_BATTERY_REPORT     1
 
-#define AO_STACK_SIZE  384
+#define AO_STACK_SIZE          352
+#define SLEEP_HASH_SIZE                3
+#define AO_NUM_TASKS           6
 
 #define IS_FLASH_LOADER        0
 
 /* System clock frequency */
 #define AO_LPC_SYSCLK  24000000
 
+/* Beeper is on pio0_14 ct32b1_mat1 */
+#define BEEPER_PORT    0
+#define BEEPER_PIN     14
+#define BEEPER_TIMER   1
+#define BEEPER_OUTPUT  1
+
 #define HAS_USB                1
 
 #define HAS_USB_CONNECT        0
@@ -41,7 +50,7 @@
 
 #define PACKET_HAS_SLAVE       0
 
-#define AO_LOG_FORMAT          AO_LOG_FORMAT_EASYMINI
+#define AO_LOG_FORMAT          AO_LOG_FORMAT_EASYMINI1
 
 /* USART */
 
 #define USE_INTERNAL_FLASH     0
 #define HAS_IGNITE             1
 #define HAS_IGNITE_REPORT      1
+#define SLEEP_HASH_SIZE                3
 
 #define AO_DATA_RING           16
 
@@ -122,15 +132,30 @@ struct ao_adc {
 
 #define AO_IGNITER_DROGUE_PORT 0
 #define AO_IGNITER_DROGUE_PIN  2
-#define AO_IGNITER_SET_DROGUE(v)       ao_gpio_set(AO_IGNITER_DROGUE_PORT, AO_IGNITER_DROGUE_PIN, AO_IGNITER_DROGUE, v)
 
 #define AO_IGNITER_MAIN_PORT   0
 #define AO_IGNITER_MAIN_PIN    3
-#define AO_IGNITER_SET_MAIN(v)         ao_gpio_set(AO_IGNITER_MAIN_PORT, AO_IGNITER_MAIN_PIN, AO_IGNITER_MAIN, v)
 
 #define AO_SENSE_DROGUE(p)     ((p)->adc.sense_a)
 #define AO_SENSE_MAIN(p)       ((p)->adc.sense_m)
 
 #define AO_ADC_DUMP(p) \
-       printf("tick: %5u apogee: %5d main: %5d batt: %5d\n", \
+       printf("tick: %5lu apogee: %5d main: %5d batt: %5d\n", \
               (p)->tick, (p)->adc.sense_a, (p)->adc.sense_m, (p)->adc.v_batt)
+
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS    100     /* 100k */
+#define AO_BATTERY_DIV_MINUS   27      /* 27k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS     100     /* 100k */
+#define AO_IGNITE_DIV_MINUS    27      /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV    33