Driver for the IO Expander/LED Driver
Revision 2:0f4b9539feca, committed 2017-04-26
- Comitter:
- mwilkens241
- Date:
- Wed Apr 26 18:04:24 2017 +0000
- Parent:
- 1:0176ec93c3fe
- Commit message:
- nothing here changed lol
Changed in this revision
| SX1509.cpp | Show annotated file Show diff for this revision Revisions of this file |
| SX1509.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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
--- a/SX1509.h Thu Apr 20 17:55:01 2017 +0000
+++ b/SX1509.h Wed Apr 26 18:04:24 2017 +0000
@@ -152,6 +152,7 @@
void setBlink(uint8_t pin, uint8_t tOn, uint8_t tOff, uint8_t iOff);
void writePin(uint8_t pin, uint8_t intensity);
void setReset();
+ void fullReset();
};