Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
menbedButtonHandler.h
00001 #ifndef _MENBEDBUTTONHANDLER_H_ 00002 #define _MENBEDBUTTONHANDLER_H_ 00003 00004 #include "mbed.h" 00005 #include "menbedNavigator.h" 00006 #include "menbedButtonHandlerTimespec.h" 00007 00008 class MenbedButtonHandler { 00009 public: 00010 MenbedButtonHandler(PinName selectPin, PinName downPin, PinName upPin, PinName cancelPin, 00011 MenbedButtonHandlerTimespec *timespec, MenbedNavigator *navigator); 00012 MenbedButtonHandler(PinName selectPin, PinName downPin, PinName upPin, 00013 MenbedButtonHandlerTimespec *timespec, MenbedNavigator *navigator); 00014 MenbedButtonHandler(PinName selectPin, PinName downPin, 00015 MenbedButtonHandlerTimespec *timespec, MenbedNavigator *navigator); 00016 00017 protected: 00018 DigitalIn *select, *down, *up, *cancel; 00019 MenbedButtonHandlerTimespec *timespec; 00020 MenbedNavigator *navigator; 00021 00022 Ticker ticker; 00023 uint32_t tickerPeriod_us; 00024 uint32_t currentTime_us; 00025 00026 int numButtons; 00027 00028 uint32_t buttonPushedTime_us[4]; // Absolute time button first depressed 00029 bool buttonDebounced[4]; // Keep track of which buttons are debounced 00030 uint32_t buttonLastTypematicTime_us[4]; // Abs. time of last virtual push 00031 bool buttonAlreadyDepressed[4]; // Keep track of state b/t calls to tick() 00032 00033 void init (void); 00034 void tick (void); 00035 bool isButtonDepressed (MenbedButtonEvent::ButtonName); 00036 }; 00037 00038 #endif /* _MENBEDBUTTONHANDLER_H_ */
Generated on Thu Jul 14 2022 12:14:44 by
