summaryrefslogtreecommitdiffstats
path: root/door_lock/fpm.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/fpm.h
parentf4b0b734a595919cf451ab9448b06274c8e609a4 (diff)
downloadsmart-home-master.tar.gz
Door lock with MOSFETs and and without RFM.HEADmaster
Diffstat (limited to 'door_lock/fpm.h')
-rw-r--r--door_lock/fpm.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/door_lock/fpm.h b/door_lock/fpm.h
new file mode 100644
index 0000000..f424c56
--- /dev/null
+++ b/door_lock/fpm.h
@@ -0,0 +1,46 @@
+#ifndef FPM_R503_H
+#define FPM_R503_H
+
+#include <stdint.h>
+
+struct fpm_cfg {
+ uint16_t status;
+ uint16_t sysid;
+ uint16_t cap;
+ uint16_t sec_level;
+ uint8_t addr[4];
+ uint16_t pkt_size;
+ uint16_t baud;
+};
+
+typedef enum {
+ NIL = 0x00,
+ RED = 0x01,
+ BLUE = 0x02,
+ PURPLE = 0x03
+} LED_COLOR;
+
+typedef enum {
+ BREATHE = 0x01,
+ FLASH = 0x02,
+ ON = 0x03,
+ OFF = 0x04,
+ GRAD_ON = 0x05,
+ GRAD_OFF = 0x06,
+} LED_CTRL;
+
+uint8_t fpm_init(void);
+
+uint8_t fpm_get_cfg(struct fpm_cfg *cfg);
+
+uint8_t fpm_set_pwd(uint32_t pwd);
+
+uint16_t fpm_get_count(void);
+
+uint8_t fpm_enroll(void);
+
+uint16_t fpm_match(void);
+
+void fpm_led(LED_CTRL ctrl, LED_COLOR color, uint8_t count);
+
+#endif /* FPM_R50_H */