/**
 * @brief DSP-开方
 * @details 使用硬件dsp进行除法计算
 */
#include "lks32mc09x_dsp.h"
#include "lks32mc09x_timer.h"
volatile int a = 10000;
volatile int y;
volatile int time;
void Timer0_Init(void);
/**
 * @brief 主函数，用于测试HSI时钟输出及GPIO翻转
 */
int main(void)
{
    DSP_Init();
    Timer0_Init();

    while (1)
    {
        TIMER_StatisticsStart(TIMER0);
        y = DSP_Sqrt(a);
        time = TIMER_StatisticsStop(TIMER0);
    }
}
/**
 * @brief 配置定时器0，用来统计除法执行时间
 */
void Timer0_Init(void)
{
    TIMER_TimerInitTypeDef TIMER_InitStruct;
    TIMER_StructInit(&TIMER_InitStruct);

    TIMER_InitStruct.EN = 1;
    TIMER_InitStruct.TH = 0xffff;

    TIMER_Init(TIMER0, &TIMER_InitStruct);
    TIMER_Enable(TIMER0);
}
#include "math.h"
