[][src]Function esp_idf_sys::spicommon_dmaworkaround_req_reset

pub unsafe extern "C" fn spicommon_dmaworkaround_req_reset(
    dmachan: c_int,
    cb: dmaworkaround_cb_t,
    arg: *mut c_void
) -> bool

@brief Request a reset for a certain DMA channel

@note In some (well-defined) cases in the ESP32 (at least rev v.0 and v.1), a SPI DMA channel will get confused. This can be remedied by resetting the SPI DMA hardware in case this happens. Unfortunately, the reset knob used for thsi will reset both DMA channels, and as such can only done safely when both DMA channels are idle. These functions coordinate this.

Essentially, when a reset is needed, a driver can request this using spicommon_dmaworkaround_req_reset. This is supposed to be called with an user-supplied function as an argument. If both DMA channels are idle, this call will reset the DMA subsystem and return true. If the other DMA channel is still busy, it will return false; as soon as the other DMA channel is done, however, it will reset the DMA subsystem and call the callback. The callback is then supposed to be used to continue the SPI drivers activity.

@param dmachan DMA channel associated with the SPI host that needs a reset @param cb Callback to call in case DMA channel cannot be reset immediately @param arg Argument to the callback

@return True when a DMA reset could be executed immediately. False when it could not; in this case the callback will be called with the specified argument when the logic can execute a reset, after that reset.