summaryrefslogtreecommitdiffstats
path: root/door_lock_rfm/util.h
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-09-07 17:04:34 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-09-07 17:04:34 +0800
commit276856de6c63bbbf3e56cc08dcca00ba10080b7e (patch)
treec68484bc312cc3a8abcea4fa9f4948a6f1f65cc6 /door_lock_rfm/util.h
parentf4b0b734a595919cf451ab9448b06274c8e609a4 (diff)
downloadsmart-home-master.tar.gz
Door lock with MOSFETs and and without RFM.HEADmaster
Diffstat (limited to 'door_lock_rfm/util.h')
-rw-r--r--door_lock_rfm/util.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/door_lock_rfm/util.h b/door_lock_rfm/util.h
new file mode 100644
index 0000000..84584aa
--- /dev/null
+++ b/door_lock_rfm/util.h
@@ -0,0 +1,27 @@
+#ifndef MY_UTIL_H
+#define MY_UTIL_H
+
+#include <stdint.h>
+
+#define KEY "dM>}jdb,6gsnC$J^K 8(I5vyPemPs%;K"
+#define SYN "dM>}jdb,6gsnC$J^K 8(I5vyPemPs%;O"
+#define LOCK "R,I7l^E4j]KyLR9'*Q{Jd'zu.~!84}Ij"
+#define UNLOCK "R,I7l^E4j]KyLR9'*Q{Jd'zu.~!84}IL"
+
+#define WDLEN 32
+
+int is_btn_pressed(uint8_t pin, uint8_t btn);
+
+void xor(const char *k, const char *s, char *d, uint8_t n);
+
+uint16_t getvcc(void);
+
+void led_init(void);
+
+void led_locked(void);
+
+void led_unlocked(void);
+
+void led_bat(void);
+
+#endif /* MY_UTIL_H */