56 lines
1.5 KiB
C
56 lines
1.5 KiB
C
/**
|
||
******************************************************************************
|
||
* 内容:SY1
|
||
* 作者:zhangsan
|
||
* 版本:v1.0
|
||
* 日期:2020.04
|
||
******************************************************************************
|
||
*/
|
||
|
||
/* Includes ------------------------------------------------------------------*/
|
||
#include "stm32f10x.h"
|
||
#include "stdio.h"
|
||
#include "Delay.h"
|
||
#include "Tim.h"
|
||
#include "Led.h"
|
||
#include "Key.h"
|
||
#include "Sys.h"
|
||
#include "bsp_usart.h"
|
||
#include "bsp_adc.h"
|
||
|
||
/* Private typedef -----------------------------------------------------------*/
|
||
/* Private define ------------------------------------------------------------*/
|
||
/* Private macro -------------------------------------------------------------*/
|
||
/* Private variables ---------------------------------------------------------*/
|
||
/* Private function prototypes -----------------------------------------------*/
|
||
/* Private functions ---------------------------------------------------------*/
|
||
int main(void)
|
||
{
|
||
|
||
RCC_Configuration();
|
||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
|
||
LED_GPIO_INIT();
|
||
KEY_INIT();
|
||
|
||
|
||
USART_Config(115200);
|
||
ADCx_Init();
|
||
printf("\r\n说明:\r\n");
|
||
printf("0--关闭流水灯\r\n");
|
||
printf("1到4--打开指定灯\r\n");
|
||
printf("5--开启流水灯\r\n");
|
||
printf("6--读取开关状态以及流水灯的状态\r\n");
|
||
printf("?--查看说明\r\n");
|
||
TIM2_INIT(499,3999);
|
||
TIM3_PWM_INIT(4096,2);
|
||
while (1)
|
||
{
|
||
|
||
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|