Electricity/USER/mian.c

62 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
*Copyright ,2023 , NANOCHAP
*File name: MIAN.C
*Author:
*Version: V1.0
*Date: 2023-11-
*Description: 定时器电刺激综合测试TIMER0 + 电刺激)
*Function List:
History:
1.V1.0
Date:
Author:
Modification: 初版
*/
#include "my_header.h"
#include "ENS1_MTP.h"
#include "ENS1_CLOCK.h"
#include "ENS1_UART.h"
#include "ENS1_TIMER.h"
#include "ENS1_GPIO.h"
#include "ENS1_WAVEGEN.h"
int main(){
// 初始化系统
MTP_init();
ClockInit();
// 初始化GPIO19用于定时器指示
GPIO_IO_Init(GPIO_19, OUTPUT, GPIO_OType_PP, GPIO_NOPULL, OUTPUT_FAST, PDRV_4mA, ENABLE);
GPIO_Output(GPIO_19, LOW_LEVEL);
// 初始化UART
UART_Init(CMSDK_UART1, &UART1_Init);
UART_ITConfig(CMSDK_UART1, &UART1_ITSet);
// 配置电刺激参数
EMS_Configure(&ems_config);
// 初始化时间管理器
Time_Manager_Init();
// 初始化定时器在wavegen_Init之前
TIMER0_Init(1);
// 初始化波形生成器(电刺激)- 必须先初始化
wavegen_Init();
// 启动电刺激
EMS_Start();
while(1)
{
}
}