1、查看LED1和LED2对应的GPIO口
2、对es32f369x的gpio操作 es32f369x的gpio的特别之处,可以配置CMOS或者TTL电平、是否输入滤波功能、配置驱动能力。
3、程序代码 #include <string.h>
#include "main.h"
#include "md_syscfg.h"
#include "md_cmu.h"
#include "md_gpio.h"
int main()
{
md_gpio_init_t x;
/* Configure system clock */
md_cmu_clock_config_default();
/* Initialize SysTick Interrupt */
md_init_1ms_tick();
/* Enable ALL peripheral */
SYSCFG_UNLOCK();
md_cmu_enable_perh_all();
SYSCFG_LOCK();
x.mode = MD_GPIO_MODE_OUTPUT;
x.odos = MD_GPIO_PUSH_PULL;
x.pupd = MD_GPIO_PUSH_UP;
x.nodrv = MD_GPIO_OUT_DRIVE_1; //灌电流能力
x.podrv = MD_GPIO_OUT_DRIVE_1; //拉电流能力
x.flt = MD_GPIO_FILTER_DISABLE; //输入滤波功能
x.type = MD_GPIO_TYPE_CMOS; //cmos或者ttl电平
x.func = MD_GPIO_FUNC_1;
md_gpio_init(GPIOF, MD_GPIO_PIN_0, &x);
md_gpio_init(GPIOF, MD_GPIO_PIN_1, &x);
md_gpio_set_pin_low(GPIOF, MD_GPIO_PIN_0);
md_gpio_set_pin_low(GPIOF, MD_GPIO_PIN_1);
while (1)
{
md_delay_1ms(500);
md_gpio_set_pin_low(GPIOF, MD_GPIO_PIN_0);
md_gpio_set_pin_low(GPIOF, MD_GPIO_PIN_1);
md_delay_1ms(500);
md_gpio_set_pin_high(GPIOF, MD_GPIO_PIN_0);
md_gpio_set_pin_high(GPIOF, MD_GPIO_PIN_1);
}
}
4、blink
|