@@ -137,6 +137,7 @@ struct spi_transaction_t {
137137 */
138138 size_t length ; ///< Total data length, in bits
139139 size_t rxlength ; ///< Total data length received, should be not greater than ``length`` in full-duplex mode (0 defaults this to the value of ``length``).
140+ uint32_t override_freq_hz ; ///< New freq speed value will override for current device, remain `0` to skip update. Need about 30us each time
140141 void * user ; ///< User-defined variable. Can be used to store eg transaction ID.
141142 union {
142143 const void * tx_buffer ; ///< Pointer to transmit buffer, or NULL for no MOSI phase
@@ -205,7 +206,7 @@ esp_err_t spi_bus_remove_device(spi_device_handle_t handle);
205206 * @note Normally a device cannot start (queue) polling and interrupt
206207 * transactions simultaneously.
207208 *
208- * @param handle Device handle obtained using spi_host_add_dev
209+ * @param handle Device handle obtained using spi_bus_add_device()
209210 * @param trans_desc Description of transaction to execute
210211 * @param ticks_to_wait Ticks to wait until there's room in the queue; use portMAX_DELAY to
211212 * never time out.
@@ -228,7 +229,7 @@ esp_err_t spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t *
228229 * completed transaction so software can inspect the result and e.g. free the memory or
229230 * reuse the buffers.
230231 *
231- * @param handle Device handle obtained using spi_host_add_dev
232+ * @param handle Device handle obtained using spi_bus_add_device()
232233 * @param trans_desc Pointer to variable able to contain a pointer to the description of the transaction
233234 that is executed. The descriptor should not be modified until the descriptor is returned by
234235 spi_device_get_trans_result.
@@ -252,7 +253,7 @@ esp_err_t spi_device_get_trans_result(spi_device_handle_t handle, spi_transactio
252253 * Normally a device cannot start (queue) polling and interrupt
253254 * transactions simutanuously.
254255 *
255- * @param handle Device handle obtained using spi_host_add_dev
256+ * @param handle Device handle obtained using spi_bus_add_device()
256257 * @param trans_desc Description of transaction to execute
257258 * @return
258259 * - ESP_ERR_INVALID_ARG if parameter is invalid
@@ -267,7 +268,7 @@ esp_err_t spi_device_transmit(spi_device_handle_t handle, spi_transaction_t *tra
267268 * transactions simutanuously. Moreover, a device cannot start a new polling
268269 * transaction if another polling transaction is not finished.
269270 *
270- * @param handle Device handle obtained using spi_host_add_dev
271+ * @param handle Device handle obtained using spi_bus_add_device()
271272 * @param trans_desc Description of transaction to execute
272273 * @param ticks_to_wait Ticks to wait until there's room in the queue;
273274 * currently only portMAX_DELAY is supported.
@@ -290,7 +291,7 @@ esp_err_t spi_device_polling_start(spi_device_handle_t handle, spi_transaction_t
290291 * successfully completed. The task is not blocked, but actively busy-spins for
291292 * the transaction to be completed.
292293 *
293- * @param handle Device handle obtained using spi_host_add_dev
294+ * @param handle Device handle obtained using spi_bus_add_device()
294295 * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time
295296 out.
296297 * @return
@@ -310,7 +311,7 @@ esp_err_t spi_device_polling_end(spi_device_handle_t handle, TickType_t ticks_to
310311 * Normally a device cannot start (queue) polling and interrupt
311312 * transactions simutanuously.
312313 *
313- * @param handle Device handle obtained using spi_host_add_dev
314+ * @param handle Device handle obtained using spi_bus_add_device()
314315 * @param trans_desc Description of transaction to execute
315316 * @return
316317 * - ESP_ERR_INVALID_ARG if parameter is invalid
@@ -368,19 +369,19 @@ esp_err_t spi_device_get_actual_freq(spi_device_handle_t handle, int *freq_khz);
368369int spi_get_actual_clock (int fapb , int hz , int duty_cycle ) __attribute__((deprecated ("Please use spi_device_get_actual_freq instead" )));
369370
370371/**
371- * @brief Calculate the timing settings of specified frequency and settings.
372- *
373- * @param gpio_is_used True if using GPIO matrix, or False if iomux pins are used.
374- * @param input_delay_ns Input delay from SCLK launch edge to MISO data valid.
375- * @param eff_clk Effective clock frequency (in Hz) from `spi_get_actual_clock()`.
376- * @param dummy_o Address of dummy bits used output. Set to NULL if not needed.
377- * @param cycles_remain_o Address of cycles remaining (after dummy bits are used) output.
378- * - -1 If too many cycles remaining, suggest to compensate half a clock.
379- * - 0 If no remaining cycles or dummy bits are not used.
380- * - positive value: cycles suggest to compensate.
381- *
382- * @note If **dummy_o* is not zero, it means dummy bits should be applied in half duplex mode, and full duplex mode may not work.
383- */
372+ * @brief Calculate the timing settings of specified frequency and settings.
373+ *
374+ * @param gpio_is_used True if using GPIO matrix, or False if iomux pins are used.
375+ * @param input_delay_ns Input delay from SCLK launch edge to MISO data valid.
376+ * @param eff_clk Effective clock frequency (in Hz) from `spi_get_actual_clock()`.
377+ * @param dummy_o Address of dummy bits used output. Set to NULL if not needed.
378+ * @param cycles_remain_o Address of cycles remaining (after dummy bits are used) output.
379+ * - -1 If too many cycles remaining, suggest to compensate half a clock.
380+ * - 0 If no remaining cycles or dummy bits are not used.
381+ * - positive value: cycles suggest to compensate.
382+ *
383+ * @note If **dummy_o* is not zero, it means dummy bits should be applied in half duplex mode, and full duplex mode may not work.
384+ */
384385void spi_get_timing (bool gpio_is_used , int input_delay_ns , int eff_clk , int * dummy_o , int * cycles_remain_o );
385386
386387/**
0 commit comments