aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-11 11:53:24 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-11 11:53:24 +0200
commitda57aaed1295d72d8d840c69c0e08c0bcab46aee (patch)
tree7db2924bc085c2654797fe99c322fd55660b83ef /lib
parentc99e160261c2a443f61de8e073497cce1542821e (diff)
WIP pb-read
Diffstat (limited to 'lib')
-rw-r--r--lib/pbdrv/pb-read.h5
-rw-r--r--lib/pbdrv/pb-types.h8
-rw-r--r--lib/pbdrv/pb-write.h6
3 files changed, 13 insertions, 6 deletions
diff --git a/lib/pbdrv/pb-read.h b/lib/pbdrv/pb-read.h
index 7a6f0df..a6d7cde 100644
--- a/lib/pbdrv/pb-read.h
+++ b/lib/pbdrv/pb-read.h
@@ -1,9 +1,14 @@
#pragma once
+#include <stdint.h>
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
+void pbdrv_read_cmd(const char * data, size_t size);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/pbdrv/pb-types.h b/lib/pbdrv/pb-types.h
index 76292f6..0cafab5 100644
--- a/lib/pbdrv/pb-types.h
+++ b/lib/pbdrv/pb-types.h
@@ -1,4 +1,5 @@
#pragma once
+
#include <stdint.h>
#include <stddef.h>
@@ -14,8 +15,15 @@ extern "C" {
#define __weak
#endif
+//! I2C address (10 or 7 bit)
typedef uint16_t i2c_addr_t;
+//! binary buffer struct
+typedef struct {
+ char * data; //! pointer to data
+ size_t size; //! size of data
+} pbdrv_buf_t;
+
//! puzzle bus command types
enum pb_cmd_id {
PB_CMD_REQ_READ, //!< request a puzzle module property
diff --git a/lib/pbdrv/pb-write.h b/lib/pbdrv/pb-write.h
index 3245898..3bd53c5 100644
--- a/lib/pbdrv/pb-write.h
+++ b/lib/pbdrv/pb-write.h
@@ -6,12 +6,6 @@
extern "C" {
#endif
-//! binary buffer struct
-typedef struct {
- char * data; //! pointer to data
- size_t size; //! size of data
-} pbdrv_buf_t;
-
pbdrv_buf_t pbdrv_write_cmd_req_read(pb_cmd_req_read_t data);
pbdrv_buf_t pbdrv_write_cmd_res_read(pb_cmd_res_read_t data);
pbdrv_buf_t pbdrv_write_cmd_req_write(pb_cmd_req_write_t data);