Commit graph

9 commits

Author SHA1 Message Date
Peter Hartley
fd6d254d52 Add CHANGELOG entry and fix review comments 2024-04-15 12:10:12 +01:00
Peter Hartley
d34ef053fd Allow interrupt-driven MACRAW operation
This commit adds methods to RawDevice that enable interrupt-driven
operation. The enable_interrupt() method sets up SIMR so that
socket-level (internal) interrupts on Socket 0 cause chip-level
(external) interrupts (and as a convenience also sets S0_IR as
required). The disable_interrupt() method reverses those changes.
The clear_interrupt() method acknowledges all interrupts and is
intended to be called from the interrupt handler (or from thread mode
soon afterwards).

There is no change to existing functionality or operation if
enable_interrupt() is never called.

I did see PR#34 before filing this, but that change is focused on
TCP and UDP sockets, and my use case is MACRAW mode.

Tested on a W5500-Pico-EVB board with the RP2040 successfully receiving
and acting on active-low GPIO interrupts from W5500 via the INTn signal
on W5500 pin 36.
2024-04-15 10:47:53 +01:00
Felix Lelchuk
1eb9b25c7e Fix cursor: wrapping_add for ptr, immutable sock 2023-06-23 13:59:54 +02:00
Felix Lelchuk
1f6a8a290c Allow truncated RawDevice::read_frame()
- `RawDevice::read_frame()` succeeds with a receive buffer smaller than the frame.
- Introduce `RxCursor` and `TxCursor` to track/update RX/TX buffer pointers making
  it easier to reason about functions such as `read_frame` / `write_frame`.
2023-06-22 11:21:20 +02:00
Lachezar Lechev
c3f79c96ed
feat: derive defmt::Format for more structs and errors
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-06 12:54:55 +02:00
Ryan Summers
9196d005d5 Fixing comment 2022-04-28 11:47:07 +02:00
Ryan Summers
4afe9f6724 Updating docs 2022-04-28 11:47:07 +02:00
Ryan Summers
30293b65a5 Finalizing updates to MACRAW support after testing 2022-04-28 11:47:07 +02:00
Ryan Summers
c25cbe6fdb Adding macraw support 2022-04-28 11:47:07 +02:00