summaryrefslogtreecommitdiffstats
path: root/watch-library/watch/watch.h
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-02 16:14:47 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-02 16:14:47 -0400
commit8b92a1b44a489ad08fc1749e105ac4565d726803 (patch)
tree4790e2f8d9bf65071099ae2e93627af95e559d43 /watch-library/watch/watch.h
parent34945d78e933fc62bedcc975e88be02a0b7fcc2e (diff)
downloadSensor-Watch-8b92a1b44a489ad08fc1749e105ac4565d726803.tar.gz
Sensor-Watch-8b92a1b44a489ad08fc1749e105ac4565d726803.tar.bz2
Sensor-Watch-8b92a1b44a489ad08fc1749e105ac4565d726803.zip
thinking through deep sleep stuff
Diffstat (limited to 'watch-library/watch/watch.h')
-rw-r--r--watch-library/watch/watch.h105
1 files changed, 51 insertions, 54 deletions
diff --git a/watch-library/watch/watch.h b/watch-library/watch/watch.h
index 0a8f8a38..ece87eed 100644
--- a/watch-library/watch/watch.h
+++ b/watch-library/watch/watch.h
@@ -1,55 +1,52 @@
-/*
- * Watch.h
- *
- * Created: 4/25/2021 8:29:16 AM
- * Author: joeycastillo
- */
-
-
-#ifndef WATCH_H_
-#define WATCH_H_
-#include <stdint.h>
-#include "driver_init.h"
-#include "hpl_calendar.h"
-#include "hal_ext_irq.h"
-
-void watch_init();
-
-void watch_enable_display();
-void watch_display_pixel(uint8_t com, uint8_t seg);
-void watch_display_string(char *string, uint8_t position);
-
-void watch_enable_led(bool pwm);
-void watch_disable_led(bool pwm);
-void watch_set_led_color(uint16_t red, uint16_t green);
-void watch_set_led_red();
-void watch_set_led_green();
-void watch_set_led_yellow();
-void watch_set_led_off();
-
-void watch_set_date_time(struct calendar_date_time date_time);
-void watch_get_date_time(struct calendar_date_time *date_time);
-
-void watch_enable_tick_callback(ext_irq_cb_t callback);
-
-void watch_enable_analog(const uint8_t pin);
-
-void watch_enable_buttons();
-void watch_register_button_callback(const uint32_t pin, ext_irq_cb_t callback);
-
-void watch_enable_digital_input(const uint8_t pin);
-void watch_enable_pull_up(const uint8_t pin);
-void watch_enable_pull_down(const uint8_t pin);
-bool watch_get_pin_level(const uint8_t pin, const bool level);
-
-void watch_enable_digital_output(const uint8_t pin);
-void watch_disable_digital_output(const uint8_t pin);
-void watch_set_pin_level(const uint8_t pin, const bool level);
-
-struct io_descriptor *I2C_0_io;
-
-void watch_enable_i2c();
-void watch_i2c_send(int16_t addr, uint8_t *buf, uint16_t length);
-void watch_i2c_receive(int16_t addr, uint8_t *buf, uint16_t length);
-
+#ifndef WATCH_H_
+#define WATCH_H_
+#include <stdint.h>
+#include "driver_init.h"
+#include "hpl_calendar.h"
+#include "hal_ext_irq.h"
+
+void watch_init();
+
+void watch_enable_display();
+void watch_display_pixel(uint8_t com, uint8_t seg);
+void watch_display_string(char *string, uint8_t position);
+
+void watch_enable_led(bool pwm);
+void watch_disable_led(bool pwm);
+void watch_set_led_color(uint16_t red, uint16_t green);
+void watch_set_led_red();
+void watch_set_led_green();
+void watch_set_led_yellow();
+void watch_set_led_off();
+
+bool watch_rtc_is_enabled();
+void watch_set_date_time(struct calendar_date_time date_time);
+void watch_get_date_time(struct calendar_date_time *date_time);
+
+void watch_enable_tick_callback(ext_irq_cb_t callback);
+
+void watch_enable_analog(const uint8_t pin);
+
+void watch_enable_buttons();
+void watch_register_button_callback(const uint32_t pin, ext_irq_cb_t callback);
+
+void watch_enable_digital_input(const uint8_t pin);
+void watch_enable_pull_up(const uint8_t pin);
+void watch_enable_pull_down(const uint8_t pin);
+bool watch_get_pin_level(const uint8_t pin);
+
+void watch_enable_digital_output(const uint8_t pin);
+void watch_disable_digital_output(const uint8_t pin);
+void watch_set_pin_level(const uint8_t pin, const bool level);
+
+struct io_descriptor *I2C_0_io;
+
+void watch_enable_i2c();
+void watch_i2c_send(int16_t addr, uint8_t *buf, uint16_t length);
+void watch_i2c_receive(int16_t addr, uint8_t *buf, uint16_t length);
+
+void watch_store_backup_data(uint32_t data, uint8_t reg);
+uint32_t watch_get_backup_data(uint8_t reg);
+void watch_enter_deep_sleep();
+
#endif /* WATCH_H_ */ \ No newline at end of file