2024-12-09 11:41:44 +08:00
|
|
|
/*
|
|
|
|
* @Author : stark1898y 1658608470@qq.com
|
|
|
|
* @Date : 2024-12-09 09:50:56
|
|
|
|
* @LastEditors : stark1898y 1658608470@qq.com
|
2024-12-13 18:14:02 +08:00
|
|
|
* @LastEditTime : 2024-12-13 15:51:09
|
2024-12-09 11:41:44 +08:00
|
|
|
* @FilePath : \BLE_TYQ_CH592F\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 "CH59x_common.h"
|
|
|
|
|
|
|
|
|
2024-12-13 18:14:02 +08:00
|
|
|
/**********************BOOST 12V_EN************************ */
|
2024-12-09 11:41:44 +08:00
|
|
|
#define BOOST_EN \
|
|
|
|
do \
|
|
|
|
{ \
|
2024-12-13 18:14:02 +08:00
|
|
|
GPIOB_SetBits(GPIO_Pin_4); \
|
|
|
|
GPIOB_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \
|
2024-12-09 11:41:44 +08:00
|
|
|
} while (0);
|
|
|
|
|
|
|
|
#define BOOST_OFF_DEINIT \
|
|
|
|
do \
|
|
|
|
{ \
|
2024-12-13 18:14:02 +08:00
|
|
|
GPIOB_ResetBits(GPIO_Pin_4); \
|
|
|
|
GPIOB_ModeCfg(GPIO_Pin_4, GPIO_ModeIN_PD); \
|
2024-12-09 11:41:44 +08:00
|
|
|
} 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_Floating); \
|
|
|
|
} 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);
|
|
|
|
|
|
|
|
#endif // !__BSP_BEEP_LED_EMV_H__
|