Mini-F5333开发板烧录测评
分享作者:xiao_chong_jun
评测品牌:灵动微电子
评测型号:Mini-F5333
发布时间:2024-12-04 13:55:30
0
前言
由于比较忙,故仅以灵动微电子提供的示例程序进行演示。
开源口碑分享内容

该开发板的板载主控属于的32位ARM,由于只有板载接口,但不具备程序直接烧录的功能,故需要利用烧录器进行程序烧录。

官方提供了Keil MDK该开发板的Pack包,需要自行下载导入完成环境的搭建。

本次测试示例程序引用自官方提供的代码,这里选用LED部分进行演示。

以下是部分代码展示:

/***********************************************************************************************************************

   @file    gpio_led_toggle.c

   @author  FAE Team

   @date    08-May-2023

   @brief   THIS FILE PROVIDES ALL THE SYSTEM FUNCTIONS.

 **********************************************************************************************************************

   @attention


   <h2><center>© Copyright(c) <2023> <MindMotion></center></h2>


     Redistribution and use in source and binary forms, with or without modification, are permitted provided that the

   following conditions are met:

   1. Redistributions of source code must retain the above copyright notice,

      this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and

      the following disclaimer in the documentation and/or other materials provided with the distribution.

   3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or

      promote products derived from this software without specific prior written permission.


     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,

   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,

   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR

   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 *********************************************************************************************************************/


/* Define to prevent recursive inclusion */

#define _GPIO_LED_TOGGLE_C_


/* Files include */

#include <stdio.h>

#include "platform.h"

#include "gpio_led_toggle.h"


/**

 * @addtogroup MM32F5330_LibSamples

 * @{

 */


/**

 * @addtogroup GPIO

 * @{

 */


/**

 * @addtogroup GPIO_LED_Toggle

 * @{

 */


/* Private typedef ****************************************************************************************************/


/* Private define *****************************************************************************************************/


/* Private macro ******************************************************************************************************/


/* Private variables **************************************************************************************************/


/* Private functions **************************************************************************************************/


/***********************************************************************************************************************

 * @brief

 * @note   none

 * @param  none

 * @retval none

 *********************************************************************************************************************/

void GPIO_Configure(void)

{

   GPIO_InitTypeDef GPIO_InitStruct;


   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);

   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);


   GPIO_StructInit(&GPIO_InitStruct);

   GPIO_InitStruct.GPIO_Pin   = GPIO_Pin_10 | GPIO_Pin_11 ;

   GPIO_InitStruct.GPIO_Speed = GPIO_Speed_High;

   GPIO_InitStruct.GPIO_Mode  = GPIO_Mode_Out_PP;

   GPIO_Init(GPIOB, &GPIO_InitStruct);


   GPIO_StructInit(&GPIO_InitStruct);

   GPIO_InitStruct.GPIO_Pin   = GPIO_Pin_6 | GPIO_Pin_7;

   GPIO_InitStruct.GPIO_Speed = GPIO_Speed_High;

   GPIO_InitStruct.GPIO_Mode  = GPIO_Mode_Out_PP;

   GPIO_Init(GPIOC, &GPIO_InitStruct);


   GPIO_WriteBit(GPIOB, GPIO_Pin_10 | GPIO_Pin_11, Bit_SET);

   GPIO_WriteBit(GPIOC, GPIO_Pin_6 | GPIO_Pin_7, Bit_SET);

}


/***********************************************************************************************************************

 * @brief

 * @note   none

 * @param  none

 * @retval none

 *********************************************************************************************************************/

void GPIO_IO_Toggle(GPIO_TypeDef *GPIOn, uint16_t PINn)

{

   if (Bit_RESET == GPIO_ReadOutputDataBit(GPIOn, PINn))

   {

       GPIO_SetBits(GPIOn, PINn);

   }

   else

   {

       GPIO_ResetBits(GPIOn, PINn);

   }

}


/***********************************************************************************************************************

 * @brief

 * @note   none

 * @param  none

 * @retval none

 *********************************************************************************************************************/

void GPIO_LED_Toggle_Sample(void)

{

   printf("\r\nTest %s", __FUNCTION__);


   GPIO_Configure();


   while (1)

   {

       GPIO_IO_Toggle(GPIOB, GPIO_Pin_10);

       GPIO_IO_Toggle(GPIOB, GPIO_Pin_11);

       GPIO_IO_Toggle(GPIOC, GPIO_Pin_6);

       GPIO_IO_Toggle(GPIOC, GPIO_Pin_7);


       PLATFORM_DelayMS(100);

   }

}


/**

 * @}

 */


/**

 * @}

 */


/**

 * @}

 */


/********************************************** (C) Copyright MindMotion **********************************************/

参考链接: https://www.mindmotion.com.cn/support/development_tools/evaluation_boards/miniboard/mm32f5333d7pv/

                 https://bbs.21ic.com/icview-3384936-1-1.html



全部评论
暂无评论
0/144