1 /* 2 * Copyright (c) 2017-2019, MindMotion AE Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2019-03-13 henryhuang first version 9 */ 10 11 #include <rtthread.h> 12 #include <rtdevice.h> 13 #include "HAL_device.h" 14 /******************************************************************************************************** 15 * led_init(void) 16 ********************************************************************************************************/ led_init(void)17void led_init(void) 18 { 19 GPIO_InitTypeDef GPIO_InitStructure; 20 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); 21 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; 22 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 23 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; 24 GPIO_Init(GPIOA, &GPIO_InitStructure); 25 } 26 main(void)27int main(void) 28 { 29 int count = 1; 30 led_init(); 31 while (count++) 32 { 33 GPIO_SetBits(GPIOA, GPIO_Pin_15); 34 rt_thread_mdelay(500); 35 GPIO_ResetBits(GPIOA, GPIO_Pin_15); 36 rt_thread_mdelay(500); 37 } 38 return RT_EOK; 39 } 40