stm32_ota/ABM开发板(DTU透传APP源码)/YcOS版本/APPV4.0/HARDWARE/LED/led.c
2024-12-17 20:03:43 +08:00

47 lines
1.7 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.

#include "led.h"
#include "io.h"
#include "sysport.h"
/********************************************************************************
* @file led.c
* @author 晏诚科技 Mr.Wang
* @version V1.0.0
* @date 11-Dec-2018
* @brief 提供LED相关驱动。实现LED亮灭、闪烁、电平翻转等功能
******************************************************************************
* @使用方法:
* 先调用Led_Init()对LED初始化然后使用驱动相关“对外接口函数"实现LED功能
*******************************************************************************/
/**************************************************************************************************
* 名 称: void Led_Init(void)
* 功能说明: 主板DATA LED初始化 推挽输出模式
*************************************************************************************************/
void Led_Init(void)
{
Gpio_Init(DATA_LED_PORT, DATA_LED_PIN, GPIO_Mode_Out_PP) ;
}
/**************************************************************************************************
* 名 称: void Data_Led_Blink(void)
* 外部引用: void Wait_For_Nms(u32 nms) ;
* 功能说明: DATA灯闪烁 亮——灭——亮
*************************************************************************************************/
void Data_Led_Blink(void)
{
Data_Led_Reverse() ;
Wait_For_Nms(400) ;
Data_Led_Reverse() ;
}
/**************************************************************************************************
* 名 称: void Data_Led_Reverse(void)
* 功能说明: DATA灯翻转
*************************************************************************************************/
void Data_Led_Reverse(void)
{
Io_Reverse(DATA_LED_PORT, DATA_LED_PIN) ;
}