BTM library (consecutive reading) DIO input
Initialisation
#include "btnMgr.h"
#define u32PortInputMask ((1UL << 11) | (1UL << 12) | (1UL << 13))
static tsBTM_Config sBTM_Config; //!< Button input (state is determined by consecutive reading) management structure
static PR_BTM_HANDLER pr_BTM_handler; //!< Event handler for button input (called at the start of TickTimer)
...
// initialization
memset(&sBTM_Config, 0, sizeof(tsBTM_Config));
sBTM_Config.bmPortMask = u32PortInputMask;
sBTM_Config.u16Tick_ms = 8; // Decision cycle
sBTM_Config.u8MaxHistory = 5; // Five times the same value.
sBTM_Config.u8DeviceTimer = 0xFF; // Use TickTimer for this purpose.
pr_BTM_handler = prBTM_InitExternal(&sBTM_Config);
// Start BTM processing
vBTM_Enable();DIO's consecutive reading judgment
Detection of DIO changes
最終更新