copy from mbed
Revision 1:41dd31bbbe6d, committed 2020-06-18
- Comitter:
- irsanjul
- Date:
- Thu Jun 18 08:57:58 2020 +0000
- Parent:
- 0:b7ac3add7d83
- Commit message:
- pcf8523
Changed in this revision
| PCF8523.cpp | Show annotated file Show diff for this revision Revisions of this file |
| PCF8523.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/PCF8523.cpp Fri Mar 02 07:01:17 2018 +0000
+++ b/PCF8523.cpp Thu Jun 18 08:57:58 2020 +0000
@@ -80,6 +80,15 @@
return true;
}
+bool PCF8523::Initialize(char adr, uint8_t val)
+{
+ char buffer[4];
+ buffer[0] = val;
+ if(!write(adr, buffer[0]))return 0;
+
+ return true;
+}
+
bool PCF8523::IsConnected()
{
bool ok = false;
--- a/PCF8523.h Fri Mar 02 07:01:17 2018 +0000
+++ b/PCF8523.h Thu Jun 18 08:57:58 2020 +0000
@@ -54,6 +54,7 @@
bool check_alarm();
bool IsConnected();
bool software_reset();
+ bool Initialize(char adr, uint8_t val);
PCF8523(PinName scl, PinName sda);
~PCF8523();