summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon/src/codewheel.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon/src/codewheel.h')
-rw-r--r--digital/beacon/src/codewheel.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/digital/beacon/src/codewheel.h b/digital/beacon/src/codewheel.h
index a0ff00bd..57b4a7b5 100644
--- a/digital/beacon/src/codewheel.h
+++ b/digital/beacon/src/codewheel.h
@@ -28,9 +28,29 @@
#define CODEWHEEL_CPR 499
+typedef enum
+{
+ CODEWHEEL_INIT,
+ CODEWHEEL_REQUEST_REBASE,
+ CODEWHEEL_REBASED
+} TCodewheel_state;
+
+typedef struct
+{
+ TCodewheel_state state;
+ uint16_t rebase_offset;
+} codewheel_s;
+
/* This function initializes the codewheel optical sensors and associated interrupt */
void codewheel_init(void);
+
+/* This function returns the codewheel state */
+TCodewheel_state codewheel_get_state(void);
+
+/* This function modify the codewheel state */
+void codewheel_set_state(TCodewheel_state state);
+
/* This function returns the wheel position */
uint16_t codewheel_get_value(void);