ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
iface_bridge_hw.h File Reference

Bus glue for the interface bridge (PROTOCORE_ENABLE_IFACE_BRIDGE): the PROTO_BRIDGE listener that wires an accepted connection to a UART / SPI / I2C endpoint, plus the bus I/O. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Bus glue for the interface bridge (PROTOCORE_ENABLE_IFACE_BRIDGE): the PROTO_BRIDGE listener that wires an accepted connection to a UART / SPI / I2C endpoint, plus the bus I/O.

The pure core (iface_bridge.h) owns the rule table and the transaction frame codec; this file owns the side that reaches the seam: a ProtoConn::PROTO_BRIDGE connection handler and the uart.h / spi.h / i2c.h transfers. Layered exactly like server/net/relay - the app opens the listener, then publishes a target:

int32_t li = server.listen(2323, ProtoConn::PROTO_BRIDGE); // front port 2323
BridgeTarget uart = {BRIDGE_BUS_UART, BRIDGE_MODE_STREAM, 1, 0, 115200, 0, 0};
protocore_iface_bridge_publish((uint8_t)li, 2323, BRIDGE_PROTO_TCP, &uart); // -> UART1 raw passthrough
int32_t ls = server.listen(2324, ProtoConn::PROTO_BRIDGE);
BridgeTarget spi = {BRIDGE_BUS_SPI, BRIDGE_MODE_TRANSACTION, 0, 5, 1000000, 0, 0}; // 5 = CS gpio
protocore_iface_bridge_publish((uint8_t)ls, 2324, BRIDGE_PROTO_TCP, &spi); // -> SPI write-then-read frames

Security: a published port is a direct pipe to the bus. Only expose it on a trusted interface / behind an upstream ACL; there is no authentication at this layer.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file iface_bridge_hw.h.