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.
Diff: sx1276/arduino-mbed.h
- Revision:
- 68:66251038a897
- Parent:
- 67:d3afd803f40d
- Child:
- 69:d440a5b04708
--- 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;