Lines Matching +full:command +full:- +full:delay +full:- +full:ms

4  * SPDX-License-Identifier: Apache-2.0
34 * @name SD command timeouts
37 #define SDHC_TIMEOUT_FOREVER (-1)
41 * @brief SD host controller command structure
43 * This command structure is used to send command requests to an SD
52 int timeout_ms; /*!< Command timeout in milliseconds */
61 * This command structure is used to send data transfer requests to an SD
113 * to the bus. Cards start with legacy timing, but UHS-II cards can go up to
169 unsigned int bus_8_bit_support: 1; /**< 8-bit Support for embedded device */
179 unsigned int address_64_bit_support_v4: 1; /**< 64-bit system address support for V4 */
180 unsigned int address_64_bit_support_v3: 1; /**< 64-bit system address support for V3 */
186 unsigned int uhs_2_support: 1; /**< UHS-II support */
191 unsigned int retune_timer_count: 4; /**< Timer count for re-tuning */
193 unsigned int retuning_mode: 2; /**< Re-tuning mode */
212 enum sdhc_bus_mode bus_mode; /*!< command output mode */
228 unsigned int power_delay; /*!< Delay to allow SD to power up or down (in ms) */
285 * @retval -ETIMEDOUT: controller reset timed out
286 * @retval -EIO: reset failed
292 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_hw_reset()
294 if (!api->reset) { in z_impl_sdhc_hw_reset()
295 return -ENOSYS; in z_impl_sdhc_hw_reset()
298 return api->reset(dev); in z_impl_sdhc_hw_reset()
303 * @brief Send command to SDHC
305 * Sends a command to the SD host controller, which will send this command to
308 * @param cmd: SDHC command
309 * @param data: SDHC data. Leave NULL to send SD command without data.
310 * @retval 0 command was sent successfully
311 * @retval -ETIMEDOUT command timed out while sending
312 * @retval -ENOTSUP host controller does not support command
313 * @retval -EIO: I/O error
322 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_request()
324 if (!api->request) { in z_impl_sdhc_request()
325 return -ENOSYS; in z_impl_sdhc_request()
328 return api->request(dev, cmd, data); in z_impl_sdhc_request()
334 * I/O properties should be reconfigured when the card has been sent a command
340 * @return -ENOTSUP controller does not support these I/O settings
341 * @return -EIO controller could not configure I/O settings
348 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_set_io()
350 if (!api->set_io) { in z_impl_sdhc_set_io()
351 return -ENOSYS; in z_impl_sdhc_set_io()
354 return api->set_io(dev, io); in z_impl_sdhc_set_io()
366 * @retval -EIO I/O error
372 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_card_present()
374 if (!api->get_card_present) { in z_impl_sdhc_card_present()
375 return -ENOSYS; in z_impl_sdhc_card_present()
378 return api->get_card_present(dev); in z_impl_sdhc_card_present()
389 * @retval -ETIMEDOUT: tuning failed after timeout
390 * @retval -ENOTSUP: controller does not support tuning
391 * @retval -EIO: I/O error while tuning
397 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_execute_tuning()
399 if (!api->execute_tuning) { in z_impl_sdhc_execute_tuning()
400 return -ENOSYS; in z_impl_sdhc_execute_tuning()
403 return api->execute_tuning(dev); in z_impl_sdhc_execute_tuning()
415 * @retval -EIO I/O error
421 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_card_busy()
423 if (!api->card_busy) { in z_impl_sdhc_card_busy()
424 return -ENOSYS; in z_impl_sdhc_card_busy()
427 return api->card_busy(dev); in z_impl_sdhc_card_busy()
439 * @retval -ENOTSUP host controller does not support this call
447 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_get_host_props()
449 if (!api->get_host_props) { in z_impl_sdhc_get_host_props()
450 return -ENOSYS; in z_impl_sdhc_get_host_props()
453 return api->get_host_props(dev, props); in z_impl_sdhc_get_host_props()
468 * @retval -ENOTSUP: controller does not support this function
469 * @retval -EIO: I/O error
479 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_enable_interrupt()
481 if (!api->enable_interrupt) { in z_impl_sdhc_enable_interrupt()
482 return -ENOSYS; in z_impl_sdhc_enable_interrupt()
485 return api->enable_interrupt(dev, callback, sources, user_data); in z_impl_sdhc_enable_interrupt()
497 * @retval -ENOTSUP: controller does not support this function
498 * @retval -EIO: I/O error
505 const struct sdhc_driver_api *api = (const struct sdhc_driver_api *)dev->api; in z_impl_sdhc_disable_interrupt()
507 if (!api->disable_interrupt) { in z_impl_sdhc_disable_interrupt()
508 return -ENOSYS; in z_impl_sdhc_disable_interrupt()
511 return api->disable_interrupt(dev, sources); in z_impl_sdhc_disable_interrupt()