altos: Add spiradio product
authorKeith Packard <keithp@keithp.com>
Mon, 27 Aug 2012 20:52:11 +0000 (13:52 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 27 Aug 2012 20:52:11 +0000 (13:52 -0700)
Implements the SPI radio protocol

Signed-off-by: Keith Packard <keithp@keithp.com>
src/spiradio-v0.1/.sdcdbrc [new file with mode: 0644]
src/spiradio-v0.1/ao_pins.h [new file with mode: 0644]
src/spiradio-v0.1/ao_spiradio.c [new file with mode: 0644]

diff --git a/src/spiradio-v0.1/.sdcdbrc b/src/spiradio-v0.1/.sdcdbrc
new file mode 100644 (file)
index 0000000..b9f6129
--- /dev/null
@@ -0,0 +1,2 @@
+--directory=../cc1111:../product:../core:../drivers:.
+
diff --git a/src/spiradio-v0.1/ao_pins.h b/src/spiradio-v0.1/ao_pins.h
new file mode 100644 (file)
index 0000000..363eafa
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright © 2010 Keith Packard <keithp@keithp.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+#define HAS_RADIO              1
+
+#define HAS_FLIGHT             0
+#define HAS_USB                        0
+#define HAS_BEEP               0
+#define HAS_GPS                        0
+#define HAS_SERIAL_0           1
+#define HAS_SERIAL_0_ALT_1     1
+#define HAS_SERIAL_0_HW_FLOW   0
+#define USE_SERIAL_0_STDIN     1
+#define DELAY_SERIAL_0_STDIN   0
+#define HAS_SERIAL_1           0
+#define HAS_ADC                        0
+#define HAS_DBG                        0
+#define HAS_EEPROM             0
+#define HAS_LOG                        0
+#define USE_INTERNAL_FLASH     0
+#define DBG_ON_P1              0
+#define PACKET_HAS_MASTER      0
+#define PACKET_HAS_SLAVE       0
+#define AO_LED_RED             2
+#define AO_LED_GREEN           1
+#define LEDS_AVAILABLE         (AO_LED_RED|AO_LED_GREEN)
+#define HAS_EXTERNAL_TEMP      0
+#define HAS_ACCEL_REF          0
+#define SPI_CS_ON_P1           1
+#define HAS_AES                        1
+
+#define SPI_CS_PORT            P1
+#define SPI_CS_SEL             P1SEL
+#define SPI_CS_DIR             P1DIR
+#define AO_SPI_SLAVE           1
+#define HAS_SPI_0              1
+#define SPI_0_ALT_2            1
+#define HAS_SPI_1              0
+
+#define AO_RADIO_SLAVE_INT_PORT        P1
+#define AO_RADIO_SLAVE_INT_BIT 6
+#define AO_RADIO_SLAVE_INT_PIN P1_6
+
+#endif /* _AO_PINS_H_ */
diff --git a/src/spiradio-v0.1/ao_spiradio.c b/src/spiradio-v0.1/ao_spiradio.c
new file mode 100644 (file)
index 0000000..d3647cc
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include <ao.h>
+#include <ao_radio_spi.h>
+
+void
+main(void)
+{
+       ao_clock_init();
+
+       ao_led_init(LEDS_AVAILABLE);
+
+       ao_serial_init();
+       ao_timer_init();
+       ao_cmd_init();
+       ao_spi_init();
+       ao_radio_init();
+       ao_aes_init();
+       ao_config_init();
+       ao_radio_slave_init();
+       ao_start_scheduler();
+}