#include <ao_pad.h>
#endif
+static uint8_t cc1201;
+
static uint8_t ao_radio_mutex;
static uint8_t ao_radio_wake; /* radio ready. Also used as sleep address */
static void
ao_radio_setup(void)
{
+ uint8_t partnumber = ao_radio_reg_read(CC1200_PARTNUMBER);
+
+ if (partnumber == CC1200_PARTNUMBER_CC1201)
+ cc1201 = 1;
+
ao_radio_strobe(CC1200_SRES);
ao_radio_set_regs(radio_setup);
return (ao_radio_status() >> CC1200_STATUS_STATE) & CC1200_STATUS_STATE_MASK;
}
-#if CC1200_DEBUG
-void
+#if CC1200_DEBUG_
+static void
ao_radio_show_state(char *where)
{
printf("%s: state %d len %d rxbytes %d\n",
ao_radio_send(packet, sizeof (packet));
}
-void
+static void
ao_radio_test_recv(void)
{
static uint8_t bytes[34];
#define CC1200_FSCAL_CTRL (CC1200_EXTENDED_BIT | 0x8d)
#define CC1200_PHASE_ADJUST (CC1200_EXTENDED_BIT | 0x8e)
#define CC1200_PARTNUMBER (CC1200_EXTENDED_BIT | 0x8f)
+#define CC1200_PARTNUMBER_CC1200 0x20
+#define CC1200_PARTNUMBER_CC1201 0x21
#define CC1200_PARTVERSION (CC1200_EXTENDED_BIT | 0x90)
#define CC1200_SERIAL_STATUS (CC1200_EXTENDED_BIT | 0x91)
#define CC1200_MODEM_STATUS1 (CC1200_EXTENDED_BIT | 0x92)