Add single byte send debug function

This commit is contained in:
Allen Hill
2026-09-20 15:01:28 -07:00
parent fbf5811496
commit 5b9cb1da8b
+9
View File
@@ -350,6 +350,15 @@ Bus::Handle Bus::get() { return Handle{*this}; };
void Bus::set_dominant() { phy_set_dominant(); }
void Bus::set_recessive() { phy_set_recessive(); }
Send Bus::sendbyte(uint8_t byte, bool ack) {
auto handle = get();
uint8_t data_i = 0;
if (const Send serr = handle.send_data(&byte, 1, ack, &data_i);
serr != Send{0})
return serr;
return phy_send_done(&data_i);
}
#ifdef MEASURE_BUS
// Debug bit-timing measurement on the one physical bus; instance-scoped for
// the same reason as is_active().