Files
hpw421/project/example/driver/adc_mic_pga/app/api/key.h
T
2026-06-06 16:49:48 +08:00

85 lines
2.4 KiB
C

/*!
* \file key.h
*
* \brief The head file of key.c
*
* \copyright Revised BSD License, see section \ref LICENSE.
*
* \code
*
* _ __ _ ________ _
* | |/ /(_)___ / ____/ /_ (_)___
* | // / __ \/ / / __ \/ / __ \
* / |/ / / / / /___/ / / / / /_/ /
* /_/|_/_/_/ /_/\____/_/ /_/_/ .___/
* /_/
* (C) 2022-2025 XinChip
*
* \endcode
*
* \author ( XinChip ) Alex-J
*
* \author ( XinChip )
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __KEY_H__
#define __KEY_H__
#ifdef __cplusplus
extern "C"
{
#endif
/*-----------------------------------------------------------------------------------
INCLUDE HEADE FILES
------------------------------------------------------------------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*------------------------------------------------------------------------------------
Macros
-------------------------------------------------------------------------------------*/
#define KEY_DOWN_TIMER 10
#define KEY_LONG_TIMER 20
#define KEY_LOH_TIMER 20
#define KEY_UP_TIMER 10
// KEY NUM 0- 255
#define KEY_NUM1 0X0001
#define KEY_NUM2 0X0002
#define KEY_SHORT_DOWN 0X0000
#define KEY_SHORT_UP 0X0100
#define KEY_LONG_DOWN 0X0200
#define KEY_LONG_UP 0X0400
#define NO_KEY 0
#define REC_KEY KEY_NUM1
#define REC_KEY_SHORT_DOWN (REC_KEY | KEY_SHORT_DOWN)
#define REC_KEY_SHORT_UP (REC_KEY | KEY_SHORT_UP)
#define REC_KEY_LONG_DOWN (REC_KEY | KEY_LONG_DOWN)
#define REC_KEY_LONG_UP (REC_KEY | KEY_LONG_UP)
/*------------------------------------------------------------------------------------
TypeDef
-------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------
Global Variables
-------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------
Exported Functions
-------------------------------------------------------------------------------------*/
void app_key_init(void);
void app_key_scan(void);
#ifdef __cplusplus
}
#endif
#endif /* __KEY_H__ */