コード例 #1
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
/**
 * This function will initial M487 board.
 */
void rt_hw_board_init(void)
{
    clock_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
    rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)SRAM_END);
#elif __ICCARM__
    rt_system_heap_init(__segment_end("HEAP"), (void*)SRAM_END);
#else
    /* init memory system */
    rt_system_heap_init((void*)&__bss_end, (void*)&__ram_top);
#endif
#endif /* RT_USING_HEAP */

    rt_hw_uart_init();

#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

    SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
	
	NVIC_SetPriorityGrouping(7);
	
#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
}
コード例 #2
0
ファイル: board.c プロジェクト: AdrianHuang/rt-thread
/**
 * This function will initial LPC40xx board.
 */
void rt_hw_board_init()
{
    //init low level drivers. e.g. cpu uart etc.
    rt_components_board_init();
    //redirect RTT stdio to CONSOLE device
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
}
コード例 #3
0
ファイル: board.c プロジェクト: AubrCool/realboard-lpc4088
/**
 * This function will initial LPC17xx board.
 */
void rt_hw_board_init()
{
    /* NVIC Configuration */
#define NVIC_VTOR_MASK              0x3FFFFF80
#ifdef  VECT_TAB_RAM
    /* Set the Vector Table base location at 0x10000000 */
    SCB->VTOR  = (0x10000000 & NVIC_VTOR_MASK);
#else  /* VECT_TAB_FLASH  */
    /* Set the Vector Table base location at 0x00000000 */
    SCB->VTOR  = (0x00000000 & NVIC_VTOR_MASK);
#endif

    /* init systick */
    SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND - 1);
    /* set pend exception priority */
    NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);

    /*init uart device*/
    rt_hw_uart_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

#if LPC_EXT_SDRAM == 1
    lpc_sdram_hw_init();
    mpu_init();
#endif

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization board with RT-Thread Components */
    rt_components_board_init();
#endif
}
コード例 #4
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
void rt_hw_board_init(void)
{
    sysctl_pll_set_freq(SYSCTL_PLL0, 800000000UL);
    sysctl_pll_set_freq(SYSCTL_PLL1, 400000000UL);
    /* Init FPIOA */
    fpioa_init();
    /* Dmac init */
    dmac_init();

    /* initalize interrupt */
    rt_hw_interrupt_init();
    /* initialize hardware interrupt */
    rt_hw_uart_init();

    rt_hw_tick_init();

#ifdef RT_USING_SMP
    rt_hw_clint_ipi_enable();
#endif

#ifdef RT_USING_CONSOLE
    /* set console device */
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif /* RT_USING_CONSOLE */

#ifdef RT_USING_HEAP
    rt_kprintf("heap: [0x%08x - 0x%08x]\n", (rt_ubase_t) RT_HW_HEAP_BEGIN, (rt_ubase_t) RT_HW_HEAP_END);
    /* initialize memory system */
    rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
}
コード例 #5
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
/**
 * This function will initial board.
 */
void rt_hw_board_init(void)
{
    /* must call first to configure gpio Alternate functions according the hardware design */
    wm_gpio_config();

    wm_sys_clk_config();

#ifdef RT_USING_HEAP
    rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif

#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#if TLS_CONFIG_HARD_CRYPTO
    tls_crypto_init();
#endif

    NVIC_SystemLPConfig(NVIC_LP_SLEEPDEEP, ENABLE);
    rt_thread_idle_sethook(_idle_hook_callback);
}
コード例 #6
0
ファイル: board.c プロジェクト: pigeon0411/aclean_ct
/**
 * This function will initial STM32 board.
 */
void rt_hw_board_init(void)
{
    /* NVIC Configuration */
    NVIC_Configuration();

    /* Configure the SysTick */
    SysTick_Config( SystemCoreClock / RT_TICK_PER_SECOND );

	//SysTick_Configuration();

#if STM32_EXT_SRAM
    EXT_SRAM_Configuration();
#endif

    rt_hw_usart_init();
#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif

	stm32_hw_pin_init();

    ports_initial();

}
コード例 #7
0
ファイル: board.c プロジェクト: DigFarmer/rt-thread
/**
 * This function will initialize beaglebone board
 */
void rt_hw_board_init(void)
{
    enable_neon_fpu();
    disable_strict_align_check();

    rt_components_board_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
}
コード例 #8
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
void rt_hw_board_init()
{
    emsk_mux_init();

    rt_hw_uart_init();
    rt_components_board_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
}
コード例 #9
0
ファイル: board.c プロジェクト: onelife/rt-thread
/***************************************************************************//**
 * @brief
 *   Initialize the hardware drivers.
 *
 * @details
 *
 * @note
 *
 ******************************************************************************/
void rt_hw_driver_init(void)
{
    /* Initialize USART */
#if (defined(BSP_USING_USART1) || defined(BSP_USING_USART2) || \
    defined(BSP_USING_USART3))
    bsp_hw_usart_init();
#endif

    /* Setup Console */
    rt_console_set_device(CONSOLE_DEVICE);

#if defined(RT_USING_COMPONENTS_INIT)
    rt_components_board_init();
#else
    /* Initialize SPI */
#   if (defined(BSP_USING_SPI1) || defined(BSP_USING_SPI2) || \
    defined(BSP_USING_SPI3))
    bsp_hw_spi_init();
#   endif

    /* Initialize LED */
#   if (defined(BSP_USING_LED1) || defined(BSP_USING_LED2))
	board_hw_led_init();
#   endif

    /* Initialize OLED */
#   if defined(BSP_USING_OLED)
#       if (OLED_DEVICE_INTERFACE == INTERFACE_8BIT_80XX)
    bsp_hw_oled_init();
#       endif
#   endif

    /* Initialize RTC */
#   if defined(BSP_USING_RTC)
    bsp_hw_rtc_init();
#   endif

    /* Initialize USB */
#   if defined(BSP_USING_USB)
    bsp_hw_usb_core_init();

#       if defined(BSP_USING_USB_VIRTUAL_COM)
    board_hw_usb_com_init();
#       endif
#       if defined(BSP_USING_USB_HID_MOUSE)
    bsp_hw_usb_mouse_init();
#       endif
#   endif
#endif
}
コード例 #10
0
ファイル: board.c プロジェクト: csz-cmy/rt-thread
/**
* This function will initial FM3 Easy Kit board.
 */
void rt_hw_board_init(void)
{
    /* disable all analog input. */
    FM3_GPIO->ADE = 0;

    /* init systick */
    SysTick_Config(SystemCoreClock/RT_TICK_PER_SECOND);

    /* initialize UART device */
    rt_hw_serial_init();
    /* set console as UART device */
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
}
コード例 #11
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
/**
 * This function will initialize beaglebone board
 */
void rt_hw_board_init(void)
{
    /* initialize hardware interrupt */
    rt_hw_interrupt_init();
    /* initialize system heap */
    rt_system_heap_init(HEAP_BEGIN, HEAP_END);

    rt_components_board_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

    rt_thread_idle_sethook(idle_wfi);

#ifdef RT_USING_SMP
    /* install IPI handle */
    rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
#endif
}
コード例 #12
0
ファイル: board.c プロジェクト: 201409366/LPC1549_LPCXpresso
/**
 * This function will initial LPC15xx board.
 */
void rt_hw_board_init()
{

    /* init systick */
    SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
    /* set pend exception priority */
    NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);

    /*init uart device*/
    rt_hw_uart_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization board with RT-Thread Components */
    rt_components_board_init();
#endif
}
コード例 #13
0
ファイル: board.c プロジェクト: AlexShiLucky/rt-thread
/**
 * This function will initial board.
 */
void rt_hw_board_init(void)
{
    extern uint32_t SystemCoreClock;
    SysTick_Config(SystemCoreClock/RT_TICK_PER_SECOND);

#ifdef RT_USING_HEAP
        rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END);
#endif
    
#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
    
#ifdef RT_USING_CONSOLE
    rt_hw_uart_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
}
コード例 #14
0
/**
 * This function will initial STM32 board.
 */
void rt_hw_board_init()
{
	/* NVIC Configuration */
	NVIC_Configuration();

	/* Configure the SysTick */
	RCC_Configuration();
	SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);

    /* Call components board initial (use INIT_BOARD_EXPORT()) */
#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
#ifdef RT_USING_CONSOLE
	rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
    /* Print RCC freq info */
#ifdef PRINT_RCC_FREQ_INFO
	print_rcc_freq_info();
#endif
}
コード例 #15
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
/**
 * This function will initial Nuvoton board.
 */
void rt_hw_board_init()
{
	/* NVIC Configuration */
	NVIC_Configuration();

    /* Configure the system clock */
    rt_hw_system_init();
	/* Configure the SysTick */
	SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);

	/* Initial usart deriver, and set console device */
	rt_hw_usart_init();
#ifdef RT_USING_HEAP
    rt_system_heap_init((void *)M05X_SRAM_BEGIN, (void *)M05X_SRAM_END);
#endif
#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
}
コード例 #16
0
ファイル: board.c プロジェクト: jiezhi320/aq_flight_control
/**
 * This function will initial STM32 board.
 */
void rt_hw_board_init()
{
	rccConfiguration();
    /* NVIC Configuration */
    NVIC_Configuration();

    /* Configure the SysTick */
    SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#else
    //stm32_hw_usart_init();
    stm32_hw_pin_init();
#endif		

    
#ifdef RT_USING_CONSOLE
    rt_console_set_device(CONSOLE_DEVICE);
#endif
	
}
コード例 #17
0
ファイル: board.c プロジェクト: Cheong2K/rt-thread
void rt_hw_board_init(void)
{
    rt_hw_cache_init();
    /* init hardware interrupt */
    rt_hw_interrupt_init();
    rt_hw_uart_init();
#ifdef RT_USING_CONSOLE
    /* set console device */
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif /* RT_USING_CONSOLE */

#ifdef RT_USING_HEAP
    /* init memory system */
    rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif

    rt_hw_ost_init();
}
コード例 #18
0
ファイル: board.c プロジェクト: rtt-gimbal/rt-thread
/**
 * This function will initial STM32 board.
 */
void rt_hw_board_init()
{
    /* Configure the MPU attributes as Write Through */
    //mpu_init();

    /* Enable the CPU Cache */
    CPU_CACHE_Enable();

    /* STM32F7xx HAL library initialization:
    - Configure the Flash ART accelerator on ITCM interface
    - Configure the Systick to generate an interrupt each 1 msec
    - Set NVIC Group Priority to 4
    - Global MSP (MCU Support Package) initialization
    */
    HAL_Init();
    /* Configure the system clock @ 200 Mhz */
    SystemClock_Config();
    /* init systick */
    SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
    /* set pend exception priority */
    NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif

#ifdef RT_USING_EXT_SDRAM
    rt_system_heap_init((void*)EXT_SDRAM_BEGIN, (void*)EXT_SDRAM_END);
    sram_init();
#else
    rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END);
#endif

#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
}
コード例 #19
0
ファイル: board.c プロジェクト: heyuanjie87/rt-thread
/**
 * This function will initial TMS320F28379D board.
 */
void rt_hw_board_init()
{
    /* Configure the system clock @ 84 Mhz */
    InitSysCtrl();

    DINT;
    InitPieCtrl();

    IER = 0x0000;
    IFR = 0x0000;

    InitPieVectTable();

    EALLOW;  // This is needed to write to EALLOW protected registers
    PieVectTable.TIMER2_INT = &cpu_timer2_isr;
    PieVectTable.RTOS_INT = &RTOSINT_Handler;
    EDIS;

    InitCpuTimers();
    ConfigCpuTimer(&CpuTimer2, 200, 1000000 / RT_TICK_PER_SECOND);
    CpuTimer2Regs.TCR.all = 0x4000;
    IER |= M_INT14;

#ifdef RT_USING_HEAP
    rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif

    rt_hw_sci_init();

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif
#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
    rt_interrupt_leave_sethook((void (*)(void))trap_rtosint);
}