125 lines
3.3 KiB
C
125 lines
3.3 KiB
C
/*
|
|
* @Author : stark1898y 1658608470@qq.com
|
|
* @Date : 2024-12-09 09:50:56
|
|
* @LastEditors : stark1898y 1658608470@qq.com
|
|
* @LastEditTime : 2024-12-17 16:12:04
|
|
* @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_beep_led_emv.h
|
|
* @Description :
|
|
*
|
|
* Copyright (c) 2024 by yzy, All Rights Reserved.
|
|
*/
|
|
#ifndef __BSP_BEEP_LED_EMV_H__
|
|
#define __BSP_BEEP_LED_EMV_H__
|
|
|
|
|
|
#include "CONFIG.h"
|
|
|
|
extern tmosTaskID led_task_id;
|
|
|
|
#define LED_SHOW_START_EVT (0x0001 << 0)
|
|
#define LED_SHOW_ONCE_EVT (0x0001 << 1)
|
|
|
|
#define LED_SHOW_END_EVT (0x0001 << 2)
|
|
|
|
#define CLOSE_VALVE_ACTION_EVT (0x0001 << 3)
|
|
#define LOW_VBAT_EVT (0x0001 << 4)
|
|
#define HIGH_TEMP_EVT (0x0001 << 5)
|
|
|
|
|
|
/**********************BOOST 12V_EN************************ */
|
|
#define BOOST_EN \
|
|
do \
|
|
{ \
|
|
GPIOB_SetBits(GPIO_Pin_4); \
|
|
GPIOB_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \
|
|
} while (0);
|
|
|
|
#define BOOST_OFF_DEINIT \
|
|
do \
|
|
{ \
|
|
GPIOB_ResetBits(GPIO_Pin_4); \
|
|
GPIOB_ModeCfg(GPIO_Pin_4, GPIO_ModeIN_PD); \
|
|
} while (0);
|
|
|
|
/***********************BEEP************************ */
|
|
#define BEEP_ON \
|
|
do \
|
|
{ \
|
|
GPIOA_SetBits(GPIO_Pin_14); \
|
|
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeOut_PP_5mA);\
|
|
} while (0);
|
|
|
|
#define BEEP_OFF_DEINIT \
|
|
do \
|
|
{ \
|
|
GPIOA_ResetBits(GPIO_Pin_14); \
|
|
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating); \
|
|
} while (0);
|
|
|
|
/***********************LED************************ */
|
|
/**********LED_R**************/
|
|
#define LED_R_ON \
|
|
do \
|
|
{ \
|
|
GPIOA_SetBits(GPIO_Pin_4); \
|
|
GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \
|
|
} while (0);
|
|
/**********LED_G**************/
|
|
#define LED_G_ON \
|
|
do \
|
|
{ \
|
|
GPIOA_SetBits(GPIO_Pin_5); \
|
|
GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA); \
|
|
} while (0);
|
|
/**********LED_Y**************/
|
|
#define LED_Y_ON \
|
|
do \
|
|
{ \
|
|
GPIOA_SetBits(GPIO_Pin_15); \
|
|
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA); \
|
|
} while (0);
|
|
|
|
#define LED_ALL_OFF_DEINIT \
|
|
do \
|
|
{ \
|
|
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15); \
|
|
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD); \
|
|
} while (0);
|
|
|
|
/***********************EMV************************ */
|
|
// EMV_CHARGE
|
|
#define EMV_CHARGE_EN \
|
|
do \
|
|
{ \
|
|
GPIOB_SetBits(GPIO_Pin_13); \
|
|
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA); \
|
|
} while (0);
|
|
|
|
#define EMV_CHARGE_OFF_DEINIT \
|
|
do \
|
|
{ \
|
|
GPIOB_ResetBits(GPIO_Pin_13); \
|
|
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_PD); \
|
|
} while (0);
|
|
|
|
// EMV_EN
|
|
#define EMV_ON \
|
|
do \
|
|
{ \
|
|
GPIOB_SetBits(GPIO_Pin_12); \
|
|
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeOut_PP_5mA);\
|
|
} while (0);
|
|
|
|
#define EMV_OFF_DEINIT \
|
|
do \
|
|
{ \
|
|
GPIOB_ResetBits(GPIO_Pin_12); \
|
|
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeIN_Floating); \
|
|
} while (0);
|
|
|
|
void BSP_BEEP_LED_EMV_Init(void);
|
|
|
|
void ShowLed();
|
|
|
|
#endif // !__BSP_BEEP_LED_EMV_H__
|