Skip to content

Commit 394a175

Browse files
committed
[nrf fromtree] drivers: mspi: Add timeout callback to MSPI API
This is a new callback option that drivers can use for when a request or xfer has timed out. E.g if an Async RX request never received anything, this callback can be used so a user can clean up their application. Signed-off-by: David Jewsbury <[email protected]> (cherry picked from commit a322957)
1 parent 8e8f7cd commit 394a175

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

doc/hardware/peripherals/mspi.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ whether to support scatter IO and callback management. The controller can determ
100100
which user callback to trigger based on :c:enum:`mspi_bus_event_cb_mask` upon completion
101101
of each async/sync transfer if the callback had been registered using
102102
:c:func:`mspi_register_callback`. Or not to trigger any callback at all with
103-
:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered.
104-
In which case that a controller supports hardware command queue, user could take full
105-
advantage of the hardware performance if scatter IO and callback management are supported
106-
by the driver implementation.
103+
:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered. If the implemented
104+
driver support it, the API supports :c:enum:`MSPI_BUS_XFER_COMPLETE_CB` to signal when a
105+
transfer finishes and :c:enum:`MSPI_BUS_TIMEOUT_CB` to signal when a transfer or request
106+
has timed-out. In which case that a controller supports hardware command queue, user could
107+
take full advantage of the hardware performance if scatter IO and callback management are
108+
supported by the driver implementation.
107109

108110
Device Tree
109111
===========

include/zephyr/drivers/mspi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ enum mspi_bus_event {
126126
MSPI_BUS_RESET = 0,
127127
MSPI_BUS_ERROR = 1,
128128
MSPI_BUS_XFER_COMPLETE = 2,
129+
/** @brief When a request or xfer has timed out */
130+
MSPI_BUS_TIMEOUT = 3,
129131
MSPI_BUS_EVENT_MAX,
130132
};
131133

@@ -139,6 +141,7 @@ enum mspi_bus_event_cb_mask {
139141
MSPI_BUS_RESET_CB = BIT(0),
140142
MSPI_BUS_ERROR_CB = BIT(1),
141143
MSPI_BUS_XFER_COMPLETE_CB = BIT(2),
144+
MSPI_BUS_TIMEOUT_CB = BIT(3),
142145
};
143146

144147
/**

0 commit comments

Comments
 (0)