예제 #1
0
파일: platform.c 프로젝트: zhanjun/elua
int platform_init()
{
    // Set the clocking to run from PLL
#if defined( FORLM3S9B92 ) || defined( FORLM3S9D92 )
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#else
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
#endif

    // Setup PIO
    pios_init();

    // Setup SSIs
    spis_init();

    // Setup UARTs
    uarts_init();

    // Setup timers
    timers_init();

    // Setup PWMs
    pwms_init();

#ifdef BUILD_ADC
    // Setup ADCs
    adcs_init();
#endif

#ifdef BUILD_CAN
    // Setup CANs
    cans_init();
#endif

    // Setup system timer
    cmn_systimer_set_base_freq( MAP_SysCtlClockGet() );
    cmn_systimer_set_interrupt_freq( SYSTICKHZ );

    // Setup ethernet (TCP/IP)
    eth_init();

    // Common platform initialization code
    cmn_platform_init();

    // Virtual timers
    // If the ethernet controller is used the timer is already initialized, so skip this sequence
#if VTMR_NUM_TIMERS > 0 && !defined( BUILD_UIP )
    // Configure SysTick for a periodic interrupt.
    MAP_SysTickPeriodSet( MAP_SysCtlClockGet() / SYSTICKHZ );
    MAP_SysTickEnable();
    MAP_SysTickIntEnable();
    MAP_IntMasterEnable();
#endif

    // All done
    return PLATFORM_OK;
}
예제 #2
0
파일: platform.c 프로젝트: ARMinARM/elua
int platform_init()
{
  // Set the clocking to run from PLL
  RCC_Configuration();

  // Setup IRQ's
  NVIC_Configuration();

  // Setup PIO
  pios_init();

  // Setup UARTs
  uarts_init();
  
  // Setup SPIs
  spis_init();
  
  // Setup timers
  timers_init();
  
  // Setup PWMs
  pwms_init();

#ifdef BUILD_ADC
  // Setup ADCs
  adcs_init();
#endif

  // Setup CANs
  cans_init();

  // Setup system timer
  cmn_systimer_set_base_freq( HCLK );
  cmn_systimer_set_interrupt_freq( SYSTICKHZ );
  
  // Enable SysTick
  if ( SysTick_Config( HCLK / SYSTICKHZ ) )
  { 
    /* Capture error */ 
    while (1);
  }

  // Flash initialization (for WOFS)
  FLASH_Unlock();
  
  cmn_platform_init();

  // All done
  return PLATFORM_OK;
}
예제 #3
0
int platform_init()
{

  // Setup IRQ's
  NVIC_Configuration();

  // Setup PIO
  pios_init();

  // Setup UARTs
  uarts_init();

  // Setup SPIs
  spis_init();

  // Setup timers
  timers_init();

  // Setup PWMs
  pwms_init();

#ifdef BUILD_ADC
  // Setup ADCs
  adcs_init();
#endif

#if (NUM_CAN > 0)
  // Setup CANs
  cans_init();
#endif

  // Setup system timer
  cmn_systimer_set_base_freq( HCLK );
  cmn_systimer_set_interrupt_freq( SYSTICKHZ );

  // Enable SysTick
  if ( SysTick_Config( HCLK / SYSTICKHZ ) )
  {
    /* Capture error */
    while (1);
  }

  cmn_platform_init();

  // All done
  return PLATFORM_OK;
}
예제 #4
0
int platform_init()
{
  // Set the clocking to run from PLL
  RCC_Configuration();

  // Setup IRQ's
  NVIC_Configuration();

  // Setup PIO
  pios_init();

  // Setup UARTs
  uarts_init();
  
  // Setup SPIs
  spis_init();
  
  // Setup timers
  timers_init();
  
  // Setup PWMs
  pwms_init();

#ifdef BUILD_ADC
  // Setup ADCs
  adcs_init();
#endif
  
  // Setup CANs
  cans_init();
  
  // Enable SysTick
  if ( SysTick_Config( HCLK / SYSTICKHZ ) )
  { 
    /* Capture error */ 
    while (1);
  }
  
  cmn_platform_init();

  // All done
  return PLATFORM_OK;
}
예제 #5
0
int platform_init()
{
  // Set the clocking to run from PLL
  SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

  // Setup PIO
  pios_init();

  // Setup SSIs
  spis_init();

  // Setup UARTs
  uarts_init();

  // Setup timers
  timers_init();

  // Setup PWMs
  pwms_init();

  // Setup ADCs
  adcs_init();

  // Setup ethernet (TCP/IP)
  eth_init();

  // Common platform initialization code
  cmn_platform_init();

  // Virtual timers
  // If the ethernet controller is used the timer is already initialized, so skip this sequence
#if VTMR_NUM_TIMERS > 0 && !defined( BUILD_UIP )
  // Configure SysTick for a periodic interrupt.
  SysTickPeriodSet( SysCtlClockGet() / SYSTICKHZ );
  SysTickEnable();
  SysTickIntEnable();
  IntMasterEnable();
#endif

  // All done
  return PLATFORM_OK;
}
예제 #6
0
int platform_init()
{
    // Set the clocking to run directly from the crystal.
    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

    // Setup PIO
    pios_init();

    // Setup SSIs
    spis_init();

    // Setup UARTs
    uarts_init();

    // Setup timers
    timers_init();

    // Set the send/recv functions
    std_set_send_func( uart_send );
    std_set_get_func( uart_recv );

    // All done
    return PLATFORM_OK;
}