31 #include "contiki-net.h"
34 #include "dev/cc2520/cc2520.h"
35 #include "isr_compat.h"
37 #ifdef CC2520_CONF_SFD_TIMESTAMPS
38 #define CONF_SFD_TIMESTAMPS CC2520_CONF_SFD_TIMESTAMPS
41 #ifndef CONF_SFD_TIMESTAMPS
42 #define CONF_SFD_TIMESTAMPS 0
45 #ifdef CONF_SFD_TIMESTAMPS
46 #include "cc2520-arch-sfd.h"
50 ISR(CC2520_IRQ, cc2520_port1_interrupt)
52 ENERGEST_ON(ENERGEST_TYPE_IRQ);
54 if(cc2520_interrupt()) {
58 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
62 cc2520_arch_init(
void)
67 CC2520_CSN_PORT(DIR) |= BV(CC2520_CSN_PIN);
68 CC2520_VREG_PORT(DIR) |= BV(CC2520_VREG_PIN);
69 CC2520_RESET_PORT(DIR) |= BV(CC2520_RESET_PIN);
71 CC2520_FIFOP_PORT(DIR) &= ~(BV(CC2520_FIFOP_PIN));
72 CC2520_FIFO_PORT(DIR) &= ~(BV(CC2520_FIFO_PIN));
73 CC2520_CCA_PORT(DIR) &= ~(BV(CC2520_CCA_PIN));
74 CC2520_SFD_PORT(DIR) &= ~(BV(CC2520_SFD_PIN));
76 #if CONF_SFD_TIMESTAMPS
77 cc2520_arch_sfd_init();
void spi_init(void)
Initialize the SPI bus.