BLE_TYQ_CH584M/BSP/inc/bsp_beep_led_emv.h

125 lines
3.3 KiB
C
Raw Normal View History

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
2025-02-21 14:38:41 +08:00
* @LastEditTime : 2024-12-30 10:46:06
2024-12-30 10:15:27 +08:00
* @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_beep_led_emv.h
2024-12-09 11:41:44 +08:00
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
*/
#ifndef __BSP_BEEP_LED_EMV_H__
#define __BSP_BEEP_LED_EMV_H__
#include "CONFIG.h"
2024-12-09 11:41:44 +08:00
2024-12-17 14:51:12 +08:00
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)
2024-12-09 11:41:44 +08:00
2025-02-21 14:38:41 +08:00
/**********************BOOST 12V_EN PB15************************ */
2024-12-09 11:41:44 +08:00
#define BOOST_EN \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOB_SetBits(GPIO_Pin_15); \
GPIOB_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA); \
2024-12-09 11:41:44 +08:00
} while (0);
#define BOOST_OFF_DEINIT \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOB_ResetBits(GPIO_Pin_15); \
GPIOB_ModeCfg(GPIO_Pin_15, GPIO_ModeIN_PD); \
2024-12-09 11:41:44 +08:00
} while (0);
2025-02-21 14:38:41 +08:00
/***********************BEEP PB1************************ */
2024-12-09 11:41:44 +08:00
#define BEEP_ON \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOB_SetBits(GPIO_Pin_1); \
GPIOB_ModeCfg(GPIO_Pin_1, GPIO_ModeOut_PP_5mA);\
2024-12-09 11:41:44 +08:00
} while (0);
#define BEEP_OFF_DEINIT \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOB_ResetBits(GPIO_Pin_1); \
GPIOB_ModeCfg(GPIO_Pin_1, GPIO_ModeIN_Floating); \
2024-12-09 11:41:44 +08:00
} while (0);
/***********************LED************************ */
2025-02-21 14:38:41 +08:00
/**********LED_R PA4**************/
2024-12-09 11:41:44 +08:00
#define LED_R_ON \
do \
{ \
GPIOA_SetBits(GPIO_Pin_4); \
GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \
} while (0);
2025-02-21 14:38:41 +08:00
/**********LED_G PA5**************/
2024-12-09 11:41:44 +08:00
#define LED_G_ON \
do \
{ \
GPIOA_SetBits(GPIO_Pin_5); \
GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA); \
} while (0);
2025-02-21 14:38:41 +08:00
/**********LED_Y PA6**************/
2024-12-09 11:41:44 +08:00
#define LED_Y_ON \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_SetBits(GPIO_Pin_6); \
GPIOA_ModeCfg(GPIO_Pin_6, GPIO_ModeOut_PP_5mA); \
2024-12-09 11:41:44 +08:00
} while (0);
#define LED_ALL_OFF_DEINIT \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6); \
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6, GPIO_ModeIN_PD); \
2024-12-09 11:41:44 +08:00
} while (0);
/***********************EMV************************ */
2025-02-21 14:38:41 +08:00
// EMV_CHARGE PA3
2024-12-09 11:41:44 +08:00
#define EMV_CHARGE_EN \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_SetBits(GPIO_Pin_3); \
GPIOA_ModeCfg(GPIO_Pin_3, GPIO_ModeOut_PP_5mA); \
2024-12-09 11:41:44 +08:00
} while (0);
#define EMV_CHARGE_OFF_DEINIT \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_ResetBits(GPIO_Pin_3); \
GPIOA_ModeCfg(GPIO_Pin_3, GPIO_ModeIN_PD); \
2024-12-09 11:41:44 +08:00
} while (0);
2025-02-21 14:38:41 +08:00
// EMV_EN PA15
2024-12-09 11:41:44 +08:00
#define EMV_ON \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_SetBits(GPIO_Pin_15); \
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA);\
2024-12-09 11:41:44 +08:00
} while (0);
#define EMV_OFF_DEINIT \
do \
{ \
2025-02-21 14:38:41 +08:00
GPIOA_ResetBits(GPIO_Pin_15); \
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeIN_Floating); \
2024-12-09 11:41:44 +08:00
} while (0);
2024-12-17 14:51:12 +08:00
void BSP_BEEP_LED_EMV_Init(void);
void ShowLed();
2024-12-09 11:41:44 +08:00
#endif // !__BSP_BEEP_LED_EMV_H__