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: SX1509.cpp
- Revision:
- 2:0f4b9539feca
- Parent:
- 1:0176ec93c3fe
diff -r 0176ec93c3fe -r 0f4b9539feca SX1509.cpp
--- a/SX1509.cpp Thu Apr 20 17:55:01 2017 +0000
+++ b/SX1509.cpp Wed Apr 26 18:04:24 2017 +0000
@@ -110,6 +110,8 @@
pin-=8;
}
+ uint8_t buf;
+
switch(mode){
case INPUT:
//TODO: Finish this
@@ -118,7 +120,7 @@
//TODO: Finish this
break;
case LED:
- uint8_t buf = i2cRead8(inputReg);
+ buf = i2cRead8(inputReg);
buf &= ~(1<<pin);
i2cWrite8(inputReg, buf);
buf = i2cRead8(pullupReg);
@@ -176,4 +178,9 @@
uint8_t buf = i2cRead8(REGMISC);
buf |= (1<<2);
i2cWrite8(REGMISC, buf);
+}
+
+void SX1509::fullReset(){
+ i2cWrite8(REGRESET, 0x12);
+ i2cWrite8(REGRESET, 0x34);
}
\ No newline at end of file