summaryrefslogtreecommitdiff
path: root/src/pcf_clock_driver.c
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcspace.com>2022-09-09 18:33:15 -0500
committerBrett Weiland <brett_weiland@bpcspace.com>2022-09-09 18:33:15 -0500
commit7b006d6f2032ac46074d693ae59a971bee327ace (patch)
tree60963598d99001e0850e34d6271db8bd65e04fa4 /src/pcf_clock_driver.c
init
Diffstat (limited to 'src/pcf_clock_driver.c')
-rw-r--r--src/pcf_clock_driver.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pcf_clock_driver.c b/src/pcf_clock_driver.c
new file mode 100644
index 0000000..c02a934
--- /dev/null
+++ b/src/pcf_clock_driver.c
@@ -0,0 +1,15 @@
+#include <i2c.h>
+#define CLOCK_ADDR 0x51
+
+#ifdef FLASH_EEPROM
+void flash_clock() {
+ i2c_write_reg(EEPROM_ADDR, 0x00, 0x58); //resets clock
+ i2c_write_reg(CLOCK_ADDR, 0x00, 0x40); //sets to 12 hour time
+ i2c_write_reg(CLOCK_ADDR, 0x01, 0x08); //sets alarm interrupts on
+
+ //recieve time
+
+
+}
+ i2c_write_reg(CLOCK_ADDR, 0x03, 0x01); //free ram byte; says we've set the time
+#endif