AnsweredAssumed Answered

stm32f1xx.h to stm32f4xx.h

Question asked by longo.ricardo on Jun 17, 2013
Latest reply on Jun 19, 2013 by longo.ricardo
I need to update this function to stm32f4xx.h.

void delay_us(u32 Nus)

    SysTick_SetReload(delay_fac_us * Nus);
    SysTick_CounterCmd(SysTick_Counter_Clear); // error: 'SysTick_Counter_Clear' undeclared (first use in this function)
    SysTick_CounterCmd(SysTick_Counter_Enable); // error: 'SysTick_Counter_Enable' undeclared (first use in this function)
    do
    {
        Status = SysTick_GetFlagStatus(SysTick_FLAG_COUNT);
    }while (Status != SET);
    SysTick_CounterCmd(SysTick_Counter_Disable);
     SysTick_CounterCmd(SysTick_Counter_Clear);
}


For documentation, do not come to a conclusion.


/ ************************************************* ******************************
* Function Name: SysTick_CounterCmd
* Description: Enables or disables the SysTick counter.
* Input: - SysTick_Counter: new state of the SysTick counter.
* This parameter can be one of the Following values:
* - SysTick_Counter_Disable: Disable counter
* - SysTick_Counter_Enable: Enable counter
* - SysTick_Counter_Clear: Clear counter value to 0
* Output: None
* Return: None
************************************************** ***************************** /
void SysTick_CounterCmd (u32 SysTick_Counter)
{
   / * Check the parameters * /
   assert_param (IS_SYSTICK_COUNTER (SysTick_Counter));


   if (SysTick_Counter == SysTick_Counter_Enable)
   {
     SysTick-> CTRL | = SysTick_Counter_Enable;
   }
   else if (SysTick_Counter == SysTick_Counter_Disable)
   {
     SysTick-> CTRL & = SysTick_Counter_Disable;
   }
   else / * SysTick_Counter SysTick_Counter_Clear == * /
   {
     SysTick-> VAL = SysTick_Counter_Clear;
   }
}

Outcomes