Lines Matching refs:obj
162 cyhal_sdio_t *obj = (cyhal_sdio_t *)callback_arg; in _cyhal_sdio_ds_callback() local
163 CY_ASSERT(obj != NULL); in _cyhal_sdio_ds_callback()
187 obj->pm_transition_pending = true; in _cyhal_sdio_ds_callback()
204 if (obj->pm_transition_pending) in _cyhal_sdio_ds_callback()
213 obj->pm_transition_pending = false; in _cyhal_sdio_ds_callback()
252 cy_rslt_t cyhal_sdio_init(cyhal_sdio_t *obj, cyhal_gpio_t cmd, cyhal_gpio_t clk, cyhal_gpio_t data0… in cyhal_sdio_init() argument
254 CY_ASSERT(NULL != obj); in cyhal_sdio_init()
264 obj->resource.type = CYHAL_RSC_INVALID; in cyhal_sdio_init()
265 obj->pin_cmd = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
266 obj->pin_clk = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
267 obj->pin_data0 = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
268 obj->pin_data1 = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
269 obj->pin_data2 = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
270 obj->pin_data3 = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
277 retVal = _cyhal_sdio_configure_pin(clk, &obj->pin_clk, &_cyhal_sdio_pin_clk_config); in cyhal_sdio_init()
281 retVal = _cyhal_sdio_configure_pin(cmd, &obj->pin_cmd, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
285 retVal = _cyhal_sdio_configure_pin(data0, &obj->pin_data0, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
289 retVal = _cyhal_sdio_configure_pin(data1, &obj->pin_data1, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
293 retVal = _cyhal_sdio_configure_pin(data2, &obj->pin_data2, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
297 retVal = _cyhal_sdio_configure_pin(data3, &obj->pin_data3, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
310 obj->resource.type = udbRsc.type; in cyhal_sdio_init()
311 obj->resource.block_num = udbRsc.block_num; in cyhal_sdio_init()
312 obj->resource.channel_num = udbRsc.channel_num; in cyhal_sdio_init()
332 obj->frequencyhal_hz = _CY_HAL_SDIO_DEF_FREQ; in cyhal_sdio_init()
333 obj->block_size = _CY_HAL_SDIO_64B; in cyhal_sdio_init()
336 obj->irq_cause = 0u; in cyhal_sdio_init()
337 obj->events = 0u; in cyhal_sdio_init()
339 obj->pm_transition_pending = false; in cyhal_sdio_init()
344 obj->pm_callback_data.callback = &_cyhal_sdio_ds_callback; in cyhal_sdio_init()
345 …obj->pm_callback_data.states = (cyhal_syspm_callback_state_t)(CYHAL_SYSPM_CB_CPU_DEEPSLEEP | CYHAL… in cyhal_sdio_init()
346 obj->pm_callback_data.next = NULL; in cyhal_sdio_init()
347 obj->pm_callback_data.args = obj; in cyhal_sdio_init()
351 obj->pm_callback_data.ignore_modes = (cyhal_syspm_callback_mode_t)0; in cyhal_sdio_init()
353 _cyhal_syspm_register_peripheral_callback(&obj->pm_callback_data); in cyhal_sdio_init()
360 cyhal_sdio_free(obj); in cyhal_sdio_init()
366 void cyhal_sdio_free(cyhal_sdio_t *obj) in cyhal_sdio_free() argument
368 CY_ASSERT(NULL != obj); in cyhal_sdio_free()
374 _cyhal_utils_release_if_used(&(obj->pin_clk)); in cyhal_sdio_free()
375 _cyhal_utils_release_if_used(&(obj->pin_cmd)); in cyhal_sdio_free()
376 _cyhal_utils_release_if_used(&(obj->pin_data0)); in cyhal_sdio_free()
377 _cyhal_utils_release_if_used(&(obj->pin_data1)); in cyhal_sdio_free()
378 _cyhal_utils_release_if_used(&(obj->pin_data2)); in cyhal_sdio_free()
379 _cyhal_utils_release_if_used(&(obj->pin_data3)); in cyhal_sdio_free()
381 if (obj->resource.type != CYHAL_RSC_INVALID) in cyhal_sdio_free()
383 cyhal_hwmgr_free(&(obj->resource)); in cyhal_sdio_free()
387 _cyhal_syspm_unregister_peripheral_callback(&obj->pm_callback_data); in cyhal_sdio_free()
390 cy_rslt_t cyhal_sdio_configure(cyhal_sdio_t *obj, const cyhal_sdio_cfg_t *config) in cyhal_sdio_configure() argument
392 CY_ASSERT(NULL != obj); in cyhal_sdio_configure()
398 obj->frequencyhal_hz = config->frequencyhal_hz; in cyhal_sdio_configure()
405 obj->block_size = config->block_size; in cyhal_sdio_configure()
411 cy_rslt_t cyhal_sdio_host_send_cmd(cyhal_sdio_t *obj, cyhal_sdio_host_transfer_type_t direction, cy… in cyhal_sdio_host_send_cmd() argument
413 CY_ASSERT(NULL != obj); in cyhal_sdio_host_send_cmd()
419 if (obj->pm_transition_pending) in cyhal_sdio_host_send_cmd()
463 cy_rslt_t cyhal_sdio_host_bulk_transfer(cyhal_sdio_t *obj, cyhal_sdio_host_transfer_type_t directio… in cyhal_sdio_host_bulk_transfer() argument
465 CY_ASSERT(NULL != obj); in cyhal_sdio_host_bulk_transfer()
466 if (obj->pm_transition_pending) in cyhal_sdio_host_bulk_transfer()
494 if (length >= obj->block_size) in cyhal_sdio_host_bulk_transfer()
496 cmd.u16BlockCnt = (uint16_t) ((length + obj->block_size - 1)/obj->block_size); in cyhal_sdio_host_bulk_transfer()
497 cmd.u16BlockSize = obj->block_size; in cyhal_sdio_host_bulk_transfer()
520 cy_rslt_t cyhal_sdio_host_transfer_async(cyhal_sdio_t *obj, cyhal_sdio_host_transfer_type_t directi… in cyhal_sdio_host_transfer_async() argument
524 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_host_transfer_async()
525 CY_ASSERT(NULL != obj); in cyhal_sdio_host_transfer_async()
535 bool cyhal_sdio_is_busy(const cyhal_sdio_t *obj) in cyhal_sdio_is_busy() argument
538 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_is_busy()
542 cy_rslt_t cyhal_sdio_abort_async(cyhal_sdio_t *obj) in cyhal_sdio_abort_async() argument
545 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_abort_async()
550 void cyhal_sdio_register_callback(cyhal_sdio_t *obj, cyhal_sdio_event_callback_t callback, void *ca… in cyhal_sdio_register_callback() argument
552 _cyhal_sdio_config_struct = obj; in cyhal_sdio_register_callback()
557 void cyhal_sdio_enable_event(cyhal_sdio_t *obj, cyhal_sdio_event_t event, uint8_t intr_priority, bo… in cyhal_sdio_enable_event() argument
564 obj->irq_cause = event; in cyhal_sdio_enable_event()
575 obj->irq_cause = 0U; in cyhal_sdio_enable_event()
591 obj->events |= (uint32_t) event; in cyhal_sdio_enable_event()
595 obj->events &= (uint32_t) ~((uint32_t) event); in cyhal_sdio_enable_event()
598 _cyhal_sdio_config_struct->events = obj->events; in cyhal_sdio_enable_event()
604 cy_rslt_t cyhal_sdio_host_set_io_voltage(cyhal_sdio_t *obj, cyhal_gpio_t io_volt_sel, cyhal_sdio_ho… in cyhal_sdio_host_set_io_voltage() argument
608 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_host_set_io_voltage()
615 cy_rslt_t cyhal_sdio_init_cfg(cyhal_sdio_t *obj, const cyhal_sdio_configurator_t *cfg) in cyhal_sdio_init_cfg() argument
618 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_init_cfg()