/****************************************************************************** * Copyright (C) 2021, Xiaohua Semiconductor Co., Ltd. All rights reserved. * * This software component is licensed by XHSC under BSD 3-Clause license * (the "License"); You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************/ /****************************************************************************** ** @file main.c ** ** @brief Source file for MAIN functions ** ** @author MADS Team ** ******************************************************************************/ /****************************************************************************** * Include files ******************************************************************************/ #include #include "flash.h" #include "multi_button.h" #include "lpuart.h" #include "uart.h" #include "board_spi.h" #include "board_gpio.h" #include "board_timer.h" #include "board_uart.h" #include "board_syclk.h" #include "key_app.h" #include "rf_app.h" #include "board_config.h" extern void board_rf_pan3120_init(void); extern void board_rf_pan3120_task(void); /** ****************************************************************************** ** \brief Main function of project ** ** \return uint32_t return value, if needed ** ******************************************************************************/ int32_t main(void) { board_sysclkInit();//时钟初始化配置 board_Rch4MHzTo24MHz();//主频切换为24Mz SysTick_Config(SystemCoreClock/1000);//滴答时钟配置为1ms board_GpioInit();//gpio初始化 board_spi_int();//spi初始化 board_lpuart_config();//串口初始化 board_Timer1Cfg(60000);// Timer1配置周期为 60000*(1/24)*2 = 5000us=5ms multibutton_init();//按键功能 board_rf_pan3120_init();//PAN3120初始 while(1) { board_rf_pan3120_task(); } } /****************************************************************************** * EOF (not truncated) ******************************************************************************/