summaryrefslogtreecommitdiff
path: root/libhw/rp2040_include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-29 01:02:02 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-29 01:40:02 -0600
commit7ff738390e55d57a0f513c467a9da3b08c6902ab (patch)
tree384bd03462a9790c9c747b895cf5de0677659db7 /libhw/rp2040_include
parentaffe77a2b068a9de236f0d7703092dbfafacff5e (diff)
Add a way to make private object members
Diffstat (limited to 'libhw/rp2040_include')
-rw-r--r--libhw/rp2040_include/libhw/rp2040_hwspi.h4
-rw-r--r--libhw/rp2040_include/libhw/w5500.h7
2 files changed, 11 insertions, 0 deletions
diff --git a/libhw/rp2040_include/libhw/rp2040_hwspi.h b/libhw/rp2040_include/libhw/rp2040_hwspi.h
index db8285d..8d90dbb 100644
--- a/libhw/rp2040_include/libhw/rp2040_hwspi.h
+++ b/libhw/rp2040_include/libhw/rp2040_hwspi.h
@@ -10,6 +10,8 @@
#include <pico/binary_info.h> /* for bi_* */
+#include <libmisc/private.h>
+
#include <libhw/generic/spi.h>
enum rp2040_hwspi_instance {
@@ -20,8 +22,10 @@ enum rp2040_hwspi_instance {
struct rp2040_hwspi {
implements_spi;
+ BEGIN_PRIVATE(LIBHW_RP2040_HWSPI_H)
void /*spi_inst_t*/ *inst;
uint pin_cs;
+ END_PRIVATE(LIBHW_RP2040_HWSPI_H)
};
/**
diff --git a/libhw/rp2040_include/libhw/w5500.h b/libhw/rp2040_include/libhw/w5500.h
index 6f12c39..037d4f1 100644
--- a/libhw/rp2040_include/libhw/w5500.h
+++ b/libhw/rp2040_include/libhw/w5500.h
@@ -9,6 +9,7 @@
#include <libcr_ipc/sema.h>
#include <libcr_ipc/mutex.h>
+#include <libmisc/private.h>
#include <libhw/generic/net.h>
#include <libhw/generic/spi.h>
@@ -17,13 +18,16 @@ struct _w5500_tcp_conn {
/* const-after-init */
implements_net_stream_conn;
/* mutable */
+ BEGIN_PRIVATE(LIBHW_W5500_H)
bool read_open;
bool write_open;
+ END_PRIVATE(LIBHW_W5500_H)
};
struct _w5500_tcp_listener {
/* const-after-init */
implements_net_stream_listener;
+ BEGIN_PRIVATE(LIBHW_W5500_H)
uint8_t socknum;
struct _w5500_tcp_conn active_conn;
@@ -31,11 +35,13 @@ struct _w5500_tcp_listener {
uint16_t port;
cr_mutex_t cmd_mu;
cr_sema_t listen_sema, read_sema;
+ END_PRIVATE(LIBHW_W5500_H)
};
struct w5500 {
/* const-after-init */
implements_spi *spidev;
+ BEGIN_PRIVATE(LIBHW_W5500_H)
uint pin_intr;
uint pin_reset;
struct net_eth_addr hwaddr;
@@ -44,6 +50,7 @@ struct w5500 {
uint16_t next_local_port;
struct _w5500_tcp_listener listeners[8];
cr_sema_t intr;
+ END_PRIVATE(LIBHW_W5500_H)
};
/**