34 lines
608 B
C
34 lines
608 B
C
#include "led.h"
|
|
#include "general_type.h"
|
|
|
|
void LED_Init(void)
|
|
{
|
|
|
|
GPIO_InitTypeDef GPIO_InitStructure;
|
|
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
|
|
|
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
|
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
|
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
|
|
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
|
GPIO_SetBits(GPIOA, GPIO_Pin_1);
|
|
}
|
|
|
|
void Run_Led(int i)
|
|
{
|
|
if(i)
|
|
{
|
|
LED1_RUN(1);
|
|
}
|
|
else
|
|
{
|
|
LED1_RUN(0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|