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.
Revision 68:66251038a897, committed 2017-07-19
- Comitter:
- Helmut Tschemernjak
- Date:
- Wed Jul 19 09:36:56 2017 +0200
- Parent:
- 67:d3afd803f40d
- Child:
- 69:d440a5b04708
- Commit message:
- Added PullMode for Arduino support
Changed in this revision
| sx1276/arduino-mbed.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/sx1276/arduino-mbed.h Sun Jul 16 21:25:00 2017 +0200
+++ b/sx1276/arduino-mbed.h Wed Jul 19 09:36:56 2017 +0200
@@ -22,7 +22,10 @@
#define NC -1
#define wait_ms delay
-
+enum PinMode {
+ PullUp = 1,
+ PullDown = 2,
+};
class DigitalInOut {
public:
@@ -41,6 +44,17 @@
pinMode(_gpioPin, INPUT);
};
+ void mode(PinMode pull) {
+ switch(pull) {
+ case PullUp:
+ pinMode(_gpioPin, INPUT_PULLUP);
+ break;
+ case PullDown:
+ pinMode(_gpioPin, INPUT_PULLDOWN);
+ break;
+ }
+ }
+
int read() {
if (digitalRead(_gpioPin) == HIGH)
return 1;