P100脱机下载器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

4 years ago
  1. #include "led.h"
  2. //////////////////////////////////////////////////////////////////////////////////
  3. //������ֻ��ѧϰʹ�ã�δ���������ɣ��������������κ���;
  4. //ALIENTEK mini�SSTM32������
  5. //LED��������
  6. //����ԭ��@ALIENTEK
  7. //������̳:www.openedv.com
  8. //�޸�����:2012/9/2
  9. //�汾��V1.0
  10. //��Ȩ���У������ؾ���
  11. //Copyright(C) �������������ӿƼ����޹�˾ 2009-2019
  12. //All rights reserved
  13. //////////////////////////////////////////////////////////////////////////////////
  14. //��ʼ��PB5��PE5Ϊ������.��ʹ���������ڵ�ʱ��
  15. //LED IO��ʼ��
  16. void LED_Init(void)
  17. {
  18. GPIO_InitTypeDef GPIO_InitStructure;
  19. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOD, ENABLE); //ʹ��PA,PD�˿�ʱ��
  20. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; //LED0-->PA.8 �˿�����
  21. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //��������
  22. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IO���ٶ�Ϊ50MHz
  23. GPIO_Init(GPIOA, &GPIO_InitStructure); //�����趨������ʼ��GPIOA.8
  24. GPIO_SetBits(GPIOA,GPIO_Pin_8); //PA.8 ������
  25. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; //LED1-->PD.2 �˿�����, ��������
  26. GPIO_Init(GPIOD, &GPIO_InitStructure); //�������� ��IO���ٶ�Ϊ50MHz
  27. GPIO_SetBits(GPIOD,GPIO_Pin_2); //PD.2 ������
  28. }