예제 #1
0
static void prvSetupHardware( void )
{
    GPIO_InitTypeDef  GPIO_InitStruct;

    /* Configure Flash prefetch and Instruction cache through ART accelerator. */
#if( ART_ACCLERATOR_ENABLE != 0 )
    {
        __HAL_FLASH_ART_ENABLE();
    }
#endif /* ART_ACCLERATOR_ENABLE */

    /* Set Interrupt Group Priority */
    HAL_NVIC_SetPriorityGrouping( NVIC_PRIORITYGROUP_4 );

    /* Init the low level hardware. */
    HAL_MspInit();

    /* Configure the System clock to have a frequency of 200 MHz */
    prvSystemClockConfig();

    /* Enable GPIOB  Clock (to be able to program the configuration
    registers) and configure for LED output. */
    __GPIOG_CLK_ENABLE();
    __HAL_RCC_GPIOF_CLK_ENABLE();

    GPIO_InitStruct.Pin = GPIO_PIN_10;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
    HAL_GPIO_Init( GPIOF, &GPIO_InitStruct );

    /* MCO2 : Pin PC9 */
    HAL_RCC_MCOConfig( RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_1 );
}
예제 #2
0
파일: hardware.c 프로젝트: ccccjason/amass
/* Main hardware-setup function, called from main.c */
void vHardwareSetup(void)
{
    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
    HAL_Init();

    /* Configure the system clock */
    prvSystemClockConfig();
    xHardwareUartInit();

}