summaryrefslogtreecommitdiffstats
path: root/door_lock_rfm/fpm.h
diff options
context:
space:
mode:
Diffstat (limited to 'door_lock_rfm/fpm.h')
-rw-r--r--door_lock_rfm/fpm.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/door_lock_rfm/fpm.h b/door_lock_rfm/fpm.h
new file mode 100644
index 0000000..31f53eb
--- /dev/null
+++ b/door_lock_rfm/fpm.h
@@ -0,0 +1,38 @@
+#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 {
+ RED = 0x01,
+ BLUE = 0x02,
+ PURPLE = 0x03
+} COLOR;
+
+uint8_t fpm_init(void);
+
+uint8_t fpm_get_cfg(struct fpm_cfg *cfg);
+
+uint8_t fpm_set_pwd(uint32_t pwd);
+
+void fpm_led_on(COLOR color);
+
+void fpm_led_off(void);
+
+uint16_t fpm_get_count(void);
+
+uint8_t fpm_enroll(void);
+
+uint16_t fpm_match(void);
+
+#endif /* FPM_R50_H */