Lines Matching +full:card +full:- +full:detect
4 * SPDX-License-Identifier: Apache-2.0
37 #define SDHC_TIMEOUT_FOREVER (-1)
49 uint32_t response[4]; /*!< SD card response field */
90 * the SD card.
113 * to the bus. Cards start with legacy timing, but UHS-II cards can go up to
148 /*!< card operation voltage around 3.3v */
150 /*!< card operation voltage around 3.0v */
152 /*!< card operation voltage around 1.8v */
154 /*!< card operation voltage around 1.2v */
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 */
242 SDHC_INT_SDIO = BIT(0), /*!< Card interrupt, used by SDIO cards */
243 SDHC_INT_INSERTED = BIT(1), /*!< Card was inserted into slot */
244 SDHC_INT_REMOVED = BIT(2), /*!< Card was removed from slot */
249 * @brief SDHC card interrupt callback prototype
251 * Function prototype for SDHC card interrupt callback.
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()
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
336 * power to the SD card.
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()
358 * @brief check for SDHC card presence
360 * Checks if card is present on the SD bus. Note that if a controller
361 * requires cards be powered up to detect presence, it should do so in
364 * @retval 1 card is present
365 * @retval 0 card is not present
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()
386 * allows an application to request the SD host controller to tune the card.
388 * @retval 0 tuning succeeded, card is ready for commands
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()
407 * @brief check if SD card is busy
413 * @retval 0 card is not busy
414 * @retval 1 card is busy
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()