/* * @Author : stark1898y 1658608470@qq.com * @Date : 2024-12-09 09:50:56 * @LastEditors : stark1898y 1658608470@qq.com * @LastEditTime : 2025-02-21 18:19:03 * @FilePath : \BLE_DCF_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 "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) #define CONNECT_BEEP_START_EVT (0x0001 << 6) #define CONNECT_BEEP_END_EVT (0x0001 << 7) /**********************BOOST 12V_EN PA1************************ */ #define BOOST_APIN GPIO_Pin_1 #define BOOST_EN \ do \ { \ GPIOA_SetBits(BOOST_APIN); \ GPIOA_ModeCfg(BOOST_APIN, GPIO_ModeOut_PP_5mA); \ } while (0); #define BOOST_OFF_DEINIT \ do \ { \ GPIOA_ResetBits(BOOST_APIN); \ GPIOA_ModeCfg(BOOST_APIN, GPIO_ModeIN_PD); \ } while (0); /***********************BEEP PA0************************ */ #define BEEP_ON \ do \ { \ GPIOA_SetBits(GPIO_Pin_0); \ GPIOA_ModeCfg(GPIO_Pin_0, GPIO_ModeOut_PP_5mA);\ } while (0); #define BEEP_OFF_DEINIT \ do \ { \ GPIOA_ResetBits(GPIO_Pin_0); \ GPIOA_ModeCfg(GPIO_Pin_0, GPIO_ModeIN_Floating); \ } while (0); /***********************LED************************ */ /**********LED_R PA4**************/ #define LED_R_ON \ do \ { \ GPIOA_SetBits(GPIO_Pin_4); \ GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \ } while (0); /**********LED_G PA5**************/ #define LED_G_ON \ do \ { \ GPIOA_SetBits(GPIO_Pin_5); \ GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA); \ } while (0); /**********LED_Y PA6**************/ #define LED_Y_ON \ do \ { \ GPIOA_SetBits(GPIO_Pin_6); \ GPIOA_ModeCfg(GPIO_Pin_6, GPIO_ModeOut_PP_5mA); \ } while (0); #define LED_ALL_OFF_DEINIT \ do \ { \ 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); \ } while (0); /***********************EMV************************ */ // EMV_CHARGE PA3 #define EMV_CHARGE_EN \ do \ { \ GPIOA_SetBits(GPIO_Pin_3); \ GPIOA_ModeCfg(GPIO_Pin_3, GPIO_ModeOut_PP_5mA); \ } while (0); #define EMV_CHARGE_OFF_DEINIT \ do \ { \ GPIOA_ResetBits(GPIO_Pin_3); \ GPIOA_ModeCfg(GPIO_Pin_3, GPIO_ModeIN_PD); \ } while (0); // EMV_EN PA15 #define EMV_ON \ do \ { \ GPIOA_SetBits(GPIO_Pin_15); \ GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA);\ } while (0); #define EMV_OFF_DEINIT \ do \ { \ GPIOA_ResetBits(GPIO_Pin_15); \ GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeIN_Floating); \ } while (0); void BSP_BEEP_LED_EMV_Init(void); void ShowLed(); #endif // !__BSP_BEEP_LED_EMV_H__