Exemple #1
0
/*---------------------------------------------------------------------------*/
static void
keep_uart_on(void)
{
  cc26xx_uart_set_input(serial_line_input_byte);
}
Exemple #2
0
/**
 * \brief Main function for CC26xx-based platforms
 *
 * The same main() is used for both Srf+CC26xxEM as well as for the SensorTag
 */
int
main(void)
{
  /* Set the LF XOSC as the LF system clock source */
  select_lf_xosc();

  /*
   * Make sure to open the latches - this will be important when returning
   * from shutdown
   */
  ti_lib_pwr_ctrl_io_freeze_disable();

  /* Use DCDC instead of LDO to save current */
  ti_lib_pwr_ctrl_source_set(PWRCTRL_PWRSRC_DCDC);

  lpm_init();

  board_init();

  /* Enable flash cache and prefetch. */
  ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
  ti_lib_vims_configure(VIMS_BASE, true, true);

  gpio_interrupt_init();

  /* Clock must always be enabled for the semaphore module */
  HWREG(AUX_WUC_BASE + AUX_WUC_O_MODCLKEN1) = AUX_WUC_MODCLKEN1_SMPH;

  leds_init();

  fade(LEDS_RED);

  cc26xx_rtc_init();
  clock_init();
  rtimer_init();

  watchdog_init();
  process_init();

  random_init(0x1234);

  /* Character I/O Initialisation */
#if CC26XX_UART_CONF_ENABLE
  cc26xx_uart_init();
  cc26xx_uart_set_input(serial_line_input_byte);
#endif

  serial_line_init();

  printf("Starting " CONTIKI_VERSION_STRING "\n");
  printf("With DriverLib v%u.%02u.%02u.%u\n", DRIVERLIB_MAJOR_VER,
         DRIVERLIB_MINOR_VER, DRIVERLIB_PATCH_VER, DRIVERLIB_BUILD_ID);
  printf(BOARD_STRING " using CC%u\n", CC26XX_MODEL_CPU_VARIANT);

  process_start(&etimer_process, NULL);
  ctimer_init();

  energest_init();
  ENERGEST_ON(ENERGEST_TYPE_CPU);

  fade(LEDS_YELLOW);

  printf(" Net: ");
  printf("%s\n", NETSTACK_NETWORK.name);
  printf(" MAC: ");
  printf("%s\n", NETSTACK_MAC.name);
  printf(" RDC: ");
  printf("%s", NETSTACK_RDC.name);

  if(NETSTACK_RDC.channel_check_interval() != 0) {
    printf(", Channel Check Interval: %u ticks",
           NETSTACK_RDC.channel_check_interval());
  }
  printf("\n");

  netstack_init();

  set_rf_params();

#if NETSTACK_CONF_WITH_IPV6
  memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
  queuebuf_init();
  process_start(&tcpip_process, NULL);
#endif /* NETSTACK_CONF_WITH_IPV6 */

  fade(LEDS_GREEN);

  process_start(&sensors_process, NULL);

  autostart_start(autostart_processes);

  watchdog_start();

  fade(LEDS_ORANGE);

  while(1) {
    uint8_t r;
    do {
      r = process_run();
      watchdog_periodic();
    } while(r > 0);

    /* Drop to some low power mode */
    lpm_drop();
  }
}
Exemple #3
0
/*---------------------------------------------------------------------------*/
static void
release_uart(void)
{
  cc26xx_uart_set_input(NULL);
}
/**
 * \brief Initialise the arch-specific SLIP driver
 * \param ubr Ignored for the cc26xx
 */
void
slip_arch_init(unsigned long ubr)
{
  cc26xx_uart_set_input(slip_input_byte);
}