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()
287 retVal = _cyhal_sdio_configure_pin(clk, &obj->pin_clk, &_cyhal_sdio_pin_clk_config); in cyhal_sdio_init()
291 retVal = _cyhal_sdio_configure_pin(cmd, &obj->pin_cmd, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
295 retVal = _cyhal_sdio_configure_pin(data0, &obj->pin_data0, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
299 retVal = _cyhal_sdio_configure_pin(data1, &obj->pin_data1, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
303 retVal = _cyhal_sdio_configure_pin(data2, &obj->pin_data2, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
307 retVal = _cyhal_sdio_configure_pin(data3, &obj->pin_data3, &_cyhal_sdio_pin_config); in cyhal_sdio_init()
320 obj->resource.type = udbRsc.type; in cyhal_sdio_init()
321 obj->resource.block_num = udbRsc.block_num; in cyhal_sdio_init()
322 obj->resource.channel_num = udbRsc.channel_num; in cyhal_sdio_init()
342 obj->frequencyhal_hz = _CY_HAL_SDIO_DEF_FREQ; in cyhal_sdio_init()
343 obj->block_size = _CY_HAL_SDIO_64B; in cyhal_sdio_init()
346 obj->irq_cause = 0u; in cyhal_sdio_init()
347 obj->events = 0u; in cyhal_sdio_init()
349 obj->pm_transition_pending = false; in cyhal_sdio_init()
354 obj->pm_callback_data.callback = &_cyhal_sdio_ds_callback; in cyhal_sdio_init()
355 …obj->pm_callback_data.states = (cyhal_syspm_callback_state_t)(CYHAL_SYSPM_CB_CPU_DEEPSLEEP | CYHAL… in cyhal_sdio_init()
356 obj->pm_callback_data.next = NULL; in cyhal_sdio_init()
357 obj->pm_callback_data.args = obj; in cyhal_sdio_init()
361 obj->pm_callback_data.ignore_modes = (cyhal_syspm_callback_mode_t)0; in cyhal_sdio_init()
363 _cyhal_syspm_register_peripheral_callback(&obj->pm_callback_data); in cyhal_sdio_init()
370 cyhal_sdio_free(obj); in cyhal_sdio_init()
376 void cyhal_sdio_free(cyhal_sdio_t *obj) in cyhal_sdio_free() argument
378 CY_ASSERT(NULL != obj); in cyhal_sdio_free()
384 _cyhal_utils_release_if_used(&(obj->pin_clk)); in cyhal_sdio_free()
385 _cyhal_utils_release_if_used(&(obj->pin_cmd)); in cyhal_sdio_free()
386 _cyhal_utils_release_if_used(&(obj->pin_data0)); in cyhal_sdio_free()
387 _cyhal_utils_release_if_used(&(obj->pin_data1)); in cyhal_sdio_free()
388 _cyhal_utils_release_if_used(&(obj->pin_data2)); in cyhal_sdio_free()
389 _cyhal_utils_release_if_used(&(obj->pin_data3)); in cyhal_sdio_free()
391 if (obj->resource.type != CYHAL_RSC_INVALID) in cyhal_sdio_free()
393 cyhal_hwmgr_free(&(obj->resource)); in cyhal_sdio_free()
397 _cyhal_syspm_unregister_peripheral_callback(&obj->pm_callback_data); in cyhal_sdio_free()
400 cy_rslt_t cyhal_sdio_configure(cyhal_sdio_t *obj, const cyhal_sdio_cfg_t *config) in cyhal_sdio_configure() argument
402 CY_ASSERT(NULL != obj); in cyhal_sdio_configure()
408 obj->frequencyhal_hz = config->frequencyhal_hz; in cyhal_sdio_configure()
415 obj->block_size = config->block_size; in cyhal_sdio_configure()
421 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
423 CY_ASSERT(NULL != obj); in cyhal_sdio_host_send_cmd()
429 if (obj->pm_transition_pending) in cyhal_sdio_host_send_cmd()
473 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
475 CY_ASSERT(NULL != obj); in cyhal_sdio_host_bulk_transfer()
476 if (obj->pm_transition_pending) in cyhal_sdio_host_bulk_transfer()
504 if (length >= obj->block_size) in cyhal_sdio_host_bulk_transfer()
506 cmd.u16BlockCnt = (uint16_t) ((length + obj->block_size - 1)/obj->block_size); in cyhal_sdio_host_bulk_transfer()
507 cmd.u16BlockSize = obj->block_size; in cyhal_sdio_host_bulk_transfer()
530 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
534 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_host_transfer_async()
535 CY_ASSERT(NULL != obj); in cyhal_sdio_host_transfer_async()
545 bool cyhal_sdio_is_busy(const cyhal_sdio_t *obj) in cyhal_sdio_is_busy() argument
548 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_is_busy()
552 cy_rslt_t cyhal_sdio_abort_async(cyhal_sdio_t *obj) in cyhal_sdio_abort_async() argument
555 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_abort_async()
560 void cyhal_sdio_register_callback(cyhal_sdio_t *obj, cyhal_sdio_event_callback_t callback, void *ca… in cyhal_sdio_register_callback() argument
562 _cyhal_sdio_config_struct = obj; in cyhal_sdio_register_callback()
567 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
574 obj->irq_cause = event; in cyhal_sdio_enable_event()
585 obj->irq_cause = 0U; in cyhal_sdio_enable_event()
601 obj->events |= (uint32_t) event; in cyhal_sdio_enable_event()
605 obj->events &= (uint32_t) ~((uint32_t) event); in cyhal_sdio_enable_event()
608 _cyhal_sdio_config_struct->events = obj->events; in cyhal_sdio_enable_event()
614 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
618 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_host_set_io_voltage()
625 cy_rslt_t cyhal_sdio_init_cfg(cyhal_sdio_t *obj, const cyhal_sdio_configurator_t *cfg) in cyhal_sdio_init_cfg() argument
628 CY_UNUSED_PARAMETER(obj); in cyhal_sdio_init_cfg()