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.
externalin.h
00001 #ifndef EXTERNALIN_H 00002 #define EXTERNALIN_H 00003 00004 #include "mbed.h" 00005 #include "PCA9555.h" 00006 00007 class ExternalIn { 00008 protected: 00009 FunctionPointer _callbackChange; 00010 public: 00011 ExternalIn(PCA9555 *ioExt, unsigned int pin); 00012 ExternalIn(PCA9555 *ioExt, unsigned int pin, bool defaultState); 00013 bool read(); 00014 00015 void change(void (*function)(void)); 00016 00017 template<typename T> 00018 void change(T *object, void (T::*member)(void)) { 00019 _callbackChange.attach(object, member); 00020 } 00021 00022 private: 00023 bool pinState; 00024 PCA9555 *extIO; 00025 unsigned int inPin; 00026 00027 void callChange(void); 00028 00029 void setState(bool newState); 00030 }; 00031 00032 #endif
Generated on Wed Jul 13 2022 02:15:07 by
1.7.2