summaryrefslogtreecommitdiffstats
path: root/Sensor Watch Starter Project/hw/watch.h
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-01 18:40:03 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-01 18:40:42 -0400
commit7e330befffdc2783207b83f12f30f328f5f3318d (patch)
tree92bc6d757d4dc0409d95b40efcd40ccd7372e049 /Sensor Watch Starter Project/hw/watch.h
parenta547d78c1edfaeb9075934c87753b3352a4ece46 (diff)
downloadSensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.tar.gz
Sensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.tar.bz2
Sensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.zip
move user application code to app folder
Diffstat (limited to 'Sensor Watch Starter Project/hw/watch.h')
-rw-r--r--Sensor Watch Starter Project/hw/watch.h47
1 files changed, 19 insertions, 28 deletions
diff --git a/Sensor Watch Starter Project/hw/watch.h b/Sensor Watch Starter Project/hw/watch.h
index 53a0c111..be8d7936 100644
--- a/Sensor Watch Starter Project/hw/watch.h
+++ b/Sensor Watch Starter Project/hw/watch.h
@@ -13,50 +13,41 @@
#include "hpl_calendar.h"
#include "hal_ext_irq.h"
-typedef struct Watch {
- bool display_enabled;
- bool led_enabled;
- bool buzzer_enabled;
- bool calendar_enabled;
- bool adc_enabled;
- bool i2c_enabled;
- bool spi_enabled;
- bool eic_enabled;
-
- uint8_t num_chars;
- const uint64_t* segment_map;
-} Watch;
-
-void watch_init(Watch *watch);
-
-void watch_enable_display(Watch *watch);
-void watch_display_pixel(Watch *watch, uint8_t com, uint8_t seg);
-void watch_display_string(Watch *watch, char *string, uint8_t position);
-
-void watch_enable_led(Watch *watch);
-void watch_disable_led(Watch *watch);
+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();
+void watch_disable_led();
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_off();
-void watch_enable_date_time(Watch *watch);
+void watch_enable_date_time();
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(ext_irq_cb_t callback);
+void watch_enable_tick_callback(ext_irq_cb_t callback);
-void watch_enable_analog(Watch *watch, const uint8_t pin);
+void watch_enable_analog(const uint8_t pin);
-void watch_enable_buttons(Watch *watch);
-void watch_register_button_callback(Watch *watch, const uint32_t pin, ext_irq_cb_t callback);
+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_set_pin_level(const uint8_t pin, const bool level);
struct io_descriptor *I2C_0_io;
-void watch_enable_i2c(Watch *watch);
+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);