stm32_ota/HARDWARE/KEY/key.c

41 lines
2.5 KiB
C
Raw Permalink Normal View History

2023-12-15 06:28:06 +00:00
#include "key.h"
#include "io.h"
/********************************************************************************
* @file iodevice.c
* @author <EFBFBD>̳ϿƼ<EFBFBD> Mr.Wang
* @version V1.0.0
* @date 11-Dec-2018
* @brief <EFBFBD>ABM-EC20<EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* ABM-EC20<EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RS485<EFBFBD>շ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>š<EFBFBD>3.6V<EFBFBD><EFBFBD>ѹƬʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>
******************************************************************************
*******************************************************************************/
/**************************************************************************************************
* <EFBFBD><EFBFBD> <EFBFBD>ƣ<EFBFBD> void KeyInit(void)
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UP<EFBFBD><EFBFBD>DOWN<EFBFBD><EFBFBD>LEFT<EFBFBD><EFBFBD>RIGHT<EFBFBD><EFBFBD>Menu<EFBFBD><EFBFBD>BACK IO<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ģʽ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϣ<EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
* KEY0 KEY1 KEY2 KEY3 KEY7 KEY9<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪGPIO <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
*************************************************************************************************/
void KeyInit(void)
{
IoExti_Init(MENU_KEY_PORT, MENU_KEY_PIN, GPIO_Mode_IPU, EXTI_Trigger_Falling, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(BACK_KEY_PORT, BACK_KEY_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(KEYUP_PORT, KEYUP_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(KEYLEFT_PORT, KEYLEFT_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(KEYOK_PORT, KEYOK_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(KEYRIGHT_PORT, KEYRIGHT_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
IoExti_Init(KEYDOWN_PORT, KEYDOWN_PIN, GPIO_Mode_IPU, EXTI_Trigger_Rising, INT_RANK_6) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>INT_RANK_6
Gpio_Init(KEY0_PORT, KEY0_PIN, GPIO_Mode_IPU) ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ GPIO <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
Gpio_Init(KEY1_PORT, KEY1_PIN, GPIO_Mode_IPU) ;
Gpio_Init(KEY2_PORT, KEY2_PIN, GPIO_Mode_IPU) ;
Gpio_Init(KEY3_PORT, KEY3_PIN, GPIO_Mode_IPU) ;
Gpio_Init(KEY7_PORT, KEY7_PIN, GPIO_Mode_IPU) ;
Gpio_Init(KEY9_PORT, KEY9_PIN, GPIO_Mode_IPU) ;
}