button procedure library
Revision 3:1c47d318e457, committed 2014-08-07
- Comitter:
- ChuckTimber
- Date:
- Thu Aug 07 03:59:45 2014 +0000
- Parent:
- 2:df827b705b98
- Child:
- 4:d6a45bd85a43
- Commit message:
- Documentation updated
Changed in this revision
button.cpp | Show annotated file Show diff for this revision Revisions of this file |
button.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/button.cpp Thu Aug 07 00:49:43 2014 +0000 +++ b/button.cpp Thu Aug 07 03:59:45 2014 +0000 @@ -1,7 +1,14 @@ #include "button.h" #include "mbed.h" - -/** @file class to handle button input +/** + * @file button.cpp + * Project button handling Library + * @brief button handling library for mbed + * @version 1.0 + * @author Chuck Timber + * @date 07/08/2014 + */ +/** class to handle button input * The class use DigitalIn and Ticker * * Example: @@ -33,9 +40,7 @@ using namespace mbed; // private function -/** sample_btn input and process - * - */ +/** sample_btn input and process */ void BTN::sample_btn() { unsigned char a, b; @@ -51,11 +56,11 @@ FIL = a; } - // constructor - /** Create a BTN object connected to a DigtalIn pin - * - * @param pin - DigitalIn pin connected to the switch - */ +// constructor +/** Create a BTN object connected to a DigtalIn pin + * + * @param pin - DigitalIn pin connected to the switch + */ BTN::BTN(PinName pin) : _Pin(pin) { CMD = STAT = FIL = 0; _Tick.attach(this, &BTN::sample_btn, BTN_SAMPLING_PERIOD);
--- a/button.h Thu Aug 07 00:49:43 2014 +0000 +++ b/button.h Thu Aug 07 03:59:45 2014 +0000 @@ -3,7 +3,16 @@ #include "mbed.h" -/** @file class to handle button input +/** + * @file button.h + * Project button handling Library + * @brief button handling library for mbed + * @version 1.0 + * @author Chuck Timber + * @date 07/08/2014 + */ + +/** class to handle button input * The class use DigitalIn and Ticker * * Refered to: http://elm-chan.org/docs/tec/te03.html @@ -38,8 +47,8 @@ namespace mbed { -/* Class: BTN - * A class which uses DigitalIn and Ticker +/** Class: BTN + * A class handles button input procedure, which uses DigitalIn and Ticker */ class BTN { @@ -49,6 +58,7 @@ unsigned char STAT; private: + /** sample_btn input and process */ void sample_btn(void); unsigned char FIL; DigitalIn _Pin;