From 0aa7eb114132de8870e9e1bb89cc880bf80ef8ae Mon Sep 17 00:00:00 2001 From: jon Date: Mon, 27 Jun 2022 16:49:10 +0100 Subject: [PATCH] added ability to set/get the free ram byte on pcf85063a --- drivers/pcf85063a/pcf85063a.cpp | 8 ++++++++ drivers/pcf85063a/pcf85063a.hpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/pcf85063a/pcf85063a.cpp b/drivers/pcf85063a/pcf85063a.cpp index e922e7bf..73480766 100644 --- a/drivers/pcf85063a/pcf85063a.cpp +++ b/drivers/pcf85063a/pcf85063a.cpp @@ -178,4 +178,12 @@ namespace pimoroni { address, Registers::CONTROL_2, bits); } + void PCF85063A::set_byte(uint8_t v) { + i2c->reg_write_uint8(address, Registers::RAM_BYTE, v); + } + + uint8_t PCF85063A::get_byte() { + return i2c->reg_read_uint8(address, Registers::RAM_BYTE); + } + } \ No newline at end of file diff --git a/drivers/pcf85063a/pcf85063a.hpp b/drivers/pcf85063a/pcf85063a.hpp index bd12c211..423ced52 100644 --- a/drivers/pcf85063a/pcf85063a.hpp +++ b/drivers/pcf85063a/pcf85063a.hpp @@ -133,6 +133,10 @@ namespace pimoroni { // Clock output void set_clock_output(ClockOut co); + + // FREE byte of RAM!! + void set_byte(uint8_t v); + uint8_t get_byte(); }; } \ No newline at end of file