altos: Configure telefire SPI and LEDs correctly
authorKeith Packard <keithp@keithp.com>
Fri, 24 Aug 2012 07:46:55 +0000 (00:46 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 24 Aug 2012 07:46:55 +0000 (00:46 -0700)
This places the telefire SPI bus on USART1 option 2 and
marks the various LED functions with symbolic names.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/telefire-v0.1/Makefile
src/telefire-v0.1/ao_pins.h
src/telefire-v0.1/ao_telefire.c

index 09cb88fb45c1307019f2e32a138279d8159ccf09..cfa4b3ed37c8b9947520a869d929c23721fc763b 100644 (file)
@@ -18,6 +18,7 @@ INC = \
        ao_pins.h \
        ao_arch.h \
        ao_arch_funcs.h \
        ao_pins.h \
        ao_arch.h \
        ao_arch_funcs.h \
+       ao_pad.h \
        cc1111.h \
        ao_product.h
 
        cc1111.h \
        ao_product.h
 
index 4cf523fc587aba1f5d6a7a53e0ec119e80d6d8ab..d3a9e9e30af623e1f6352af3ba0a16023611a330 100644 (file)
@@ -29,6 +29,7 @@
 #define HAS_DBG                        0
 #define HAS_EEPROM             1
 #define HAS_LOG                        0
 #define HAS_DBG                        0
 #define HAS_EEPROM             1
 #define HAS_LOG                        0
+#define HAS_PAD                        1
 #define USE_INTERNAL_FLASH     1
 #define DBG_ON_P1              0
 #define IGNITE_ON_P2           0
 #define USE_INTERNAL_FLASH     1
 #define DBG_ON_P1              0
 #define IGNITE_ON_P2           0
 #define IGNITE_ON_P0           0
 #define PACKET_HAS_MASTER      0
 #define PACKET_HAS_SLAVE       0
 #define IGNITE_ON_P0           0
 #define PACKET_HAS_MASTER      0
 #define PACKET_HAS_SLAVE       0
-#define AO_LED_RED             2
-#define AO_LED_GREEN           1
+
+#define AO_LED_CONTINUITY(c)   (1 << (c))
+#define AO_LED_CONTINUITY_MASK (0xf)
+#define AO_LED_RX              0x10
+#define AO_LED_TX              0x20
+#define AO_LED_ARMED           0x40
+#define AO_LED_POWER           0x80
+
+#define AO_LED_RED             AO_LED_TX
+#define AO_LED_GREEN           AO_LED_RX
+
 #define LEDS_AVAILABLE         (0xff)
 #define HAS_EXTERNAL_TEMP      0
 #define HAS_ACCEL_REF          0
 #define LEDS_AVAILABLE         (0xff)
 #define HAS_EXTERNAL_TEMP      0
 #define HAS_ACCEL_REF          0
 #define SPI_CS_SEL     P1SEL
 #define SPI_CS_DIR     P1DIR
 
 #define SPI_CS_SEL     P1SEL
 #define SPI_CS_DIR     P1DIR
 
+#define SPI_CONST      0x00
+
+#define HAS_SPI_0              0
+#define HAS_SPI_1              1
+#define SPI_1_ALT_1            0
+#define SPI_1_ALT_2            1
+
 #define AO_74HC497_CS_PORT     P1
 #define AO_74HC497_CS_PIN      4
 #define AO_74HC497_CS          P1_4
 #define AO_74HC497_CS_PORT     P1
 #define AO_74HC497_CS_PIN      4
 #define AO_74HC497_CS          P1_4
@@ -82,6 +99,7 @@ struct ao_adc {
 
 #define AO_ADC_DUMP(p)                                                 \
        printf ("tick: %5u 0: %5d 1: %5d 2: %5d 3: %5d pyro: %5d batt %5d\n", \
 
 #define AO_ADC_DUMP(p)                                                 \
        printf ("tick: %5u 0: %5d 1: %5d 2: %5d 3: %5d pyro: %5d batt %5d\n", \
+               (p)->tick,                                              \
                (p)->adc.sense[0],                                      \
                (p)->adc.sense[1],                                      \
                (p)->adc.sense[2],                                      \
                (p)->adc.sense[0],                                      \
                (p)->adc.sense[1],                                      \
                (p)->adc.sense[2],                                      \
index 96413a63991a5e817bf1fc55a5ef194825e58179..c1335d666daffc01dd5ff026d155114bcf8959ee 100644 (file)
@@ -15,8 +15,9 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-#include "ao.h"
-#include "ao_pins.h"
+#include <ao.h>
+#include <ao_pad.h>
+#include <ao_74hc497.h>
 
 void
 main(void)
 
 void
 main(void)
@@ -30,11 +31,11 @@ main(void)
        ao_beep_init();
        ao_cmd_init();
        ao_spi_init();
        ao_beep_init();
        ao_cmd_init();
        ao_spi_init();
+       ao_74hc497_init();
        ao_storage_init();
        ao_usb_init();
        ao_radio_init();
        ao_storage_init();
        ao_usb_init();
        ao_radio_init();
-       ao_aes_init();
-       ao_radio_cmac_init();
+//     ao_aes_init();
        ao_pad_init();
        ao_config_init();
        ao_start_scheduler();
        ao_pad_init();
        ao_config_init();
        ao_start_scheduler();