summaryrefslogtreecommitdiff
path: root/robot/io.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 18:56:41 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 18:56:41 +0200
commite75c48a4d79a838844aab071c81b2879aab2b5ee (patch)
tree175599e4df47cad9cb655080f3cbd0029e16973f /robot/io.h
parent515ea1b4db5528a08deed32463f77cd03a7f7139 (diff)
check naming rules and moved some things around
Diffstat (limited to 'robot/io.h')
-rw-r--r--robot/io.h49
1 files changed, 5 insertions, 44 deletions
diff --git a/robot/io.h b/robot/io.h
index ce67c73..3d91799 100644
--- a/robot/io.h
+++ b/robot/io.h
@@ -1,48 +1,9 @@
#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-void w2_io_main();
-
-typedef struct {
- bool pressed;
-} w2_s_i_push;
-
-typedef struct {
- uint16_t range;
-} w2_s_i_contrast;
-
-typedef struct {
- uint16_t detection;
-} w2_s_i_distance;
-
-typedef struct {
- uint16_t charge_level;
-} w2_s_i_battery;
+#include "../shared/protocol.h"
-typedef struct {
- int speed;
-} w2_s_o_motor;
-
-typedef struct {
- bool on;
-} w2_s_o_led;
-
-typedef struct {
- char text[17]; // 16 chars + '\0'
-} w2_s_o_display;
-
-typedef struct {
- w2_s_i_push button[5];
- w2_s_i_contrast qtr[5];
- w2_s_i_distance front_distance;
- w2_s_i_distance side_distance;
- w2_s_i_battery battery;
+/** i/o module main */
+void w2_io_main();
- w2_s_o_motor motor_left;
- w2_s_o_motor motor_right;
- w2_s_o_led led_red;
- w2_s_o_led led_green;
- w2_s_o_display lcd;
-} w2_io_all;
+/** global struct containing all i/o */
+extern w2_s_io_all g_w2_io;