Lines Matching refs:obj

137     cyhal_i2c_t* obj = (cyhal_i2c_t*)_cyhal_i2c_irq_obj;  in _cyhal_i2c_irq_handler()  local
139 Cy_SCB_I2C_Interrupt(obj->base, &(obj->context)); in _cyhal_i2c_irq_handler()
141 if (obj->pending) in _cyhal_i2c_irq_handler()
145 if (0 == (Cy_SCB_I2C_MasterGetStatus(obj->base, &obj->context) & CY_SCB_I2C_MASTER_BUSY)) in _cyhal_i2c_irq_handler()
148 if (obj->pending == _CYHAL_I2C_PENDING_TX_RX) in _cyhal_i2c_irq_handler()
151 obj->pending = _CYHAL_I2C_PENDING_RX; in _cyhal_i2c_irq_handler()
152 Cy_SCB_I2C_MasterRead(obj->base, &obj->rx_config, &obj->context); in _cyhal_i2c_irq_handler()
157 obj->pending = _CYHAL_I2C_PENDING_NONE; in _cyhal_i2c_irq_handler()
188 cyhal_i2c_t *obj = (cyhal_i2c_t*)_cyhal_i2c_irq_obj; in _cyhal_i2c_cb_wrapper() local
189 …cyhal_i2c_event_t anded_events = (cyhal_i2c_event_t)(obj->irq_cause & (uint32_t)_cyhal_i2c_convert… in _cyhal_i2c_cb_wrapper()
193 obj->op_in_callback = true; in _cyhal_i2c_cb_wrapper()
194 … cyhal_i2c_event_callback_t callback = (cyhal_i2c_event_callback_t) obj->callback_data.callback; in _cyhal_i2c_cb_wrapper()
195 callback(obj->callback_data.callback_arg, anded_events); in _cyhal_i2c_cb_wrapper()
196 obj->op_in_callback = false; in _cyhal_i2c_cb_wrapper()
204 cyhal_i2c_t *obj = (cyhal_i2c_t*)_cyhal_i2c_irq_obj; in _cyhal_i2c_cb_addr_wrapper() local
205 …cyhal_i2c_addr_event_t addr_events = (cyhal_i2c_addr_event_t)(obj->addr_irq_cause & (uint32_t)_cyh… in _cyhal_i2c_cb_addr_wrapper()
215 device_address = (Cy_SCB_ReadRxFifo(obj->base)) >> 1; in _cyhal_i2c_cb_addr_wrapper()
218 obj->op_in_callback = true; in _cyhal_i2c_cb_addr_wrapper()
219 …cyhal_i2c_address_callback_t callback = (cyhal_i2c_address_callback_t) obj->addr_callback_data.cal… in _cyhal_i2c_cb_addr_wrapper()
220 cmd = callback(obj->addr_callback_data.callback_arg, addr_events, device_address); in _cyhal_i2c_cb_addr_wrapper()
221 obj->op_in_callback = false; in _cyhal_i2c_cb_addr_wrapper()
228 cyhal_i2c_t *obj = (cyhal_i2c_t*)obj_ptr; in _cyhal_i2c_pm_callback_instance() local
230 .base = (void *) (obj->base), in _cyhal_i2c_pm_callback_instance()
231 .context = (void *) &(obj->context) in _cyhal_i2c_pm_callback_instance()
246 static cy_rslt_t _cyhal_i2c_init_resources(cyhal_i2c_t *obj, cyhal_gpio_t sda, cyhal_gpio_t scl, co… in _cyhal_i2c_init_resources() argument
249 obj->resource.type = CYHAL_RSC_INVALID; in _cyhal_i2c_init_resources()
250 obj->pin_scl = CYHAL_NC_PIN_VALUE; in _cyhal_i2c_init_resources()
251 obj->pin_sda = CYHAL_NC_PIN_VALUE; in _cyhal_i2c_init_resources()
252 obj->is_clock_owned = false; in _cyhal_i2c_init_resources()
299 obj->base = _CYHAL_SCB_BASE_ADDRESSES[scb_arr_index]; in _cyhal_i2c_init_resources()
300 obj->resource = i2c_rsc; in _cyhal_i2c_init_resources()
304 obj->pin_sda = sda; in _cyhal_i2c_init_resources()
311 obj->pin_scl = scl; in _cyhal_i2c_init_resources()
318 …result = _cyhal_utils_allocate_clock(&(obj->clock), &(obj->resource), CYHAL_CLOCK_BLOCK_PERIPHERAL… in _cyhal_i2c_init_resources()
319 obj->is_clock_owned = (result == CY_RSLT_SUCCESS); in _cyhal_i2c_init_resources()
323 obj->clock = *clk; in _cyhal_i2c_init_resources()
329 …uint32_t dataRate = _cyhal_i2c_set_peri_divider((void *)obj, true, _CYHAL_I2C_MASTER_DEFAULT_FREQ,… in _cyhal_i2c_init_resources()
340 static cy_rslt_t _cyhal_i2c_init_hw(cyhal_i2c_t *obj, const cy_stc_scb_i2c_config_t *pdl_cfg) in _cyhal_i2c_init_hw() argument
342 CY_ASSERT(NULL != obj->base); in _cyhal_i2c_init_hw()
345 obj->pending = _CYHAL_I2C_PENDING_NONE; in _cyhal_i2c_init_hw()
347 obj->op_in_callback = false; in _cyhal_i2c_init_hw()
349 obj->rx_slave_buff = _cyhal_i2c_buff_info_default; in _cyhal_i2c_init_hw()
350 obj->tx_slave_buff = _cyhal_i2c_buff_info_default; in _cyhal_i2c_init_hw()
353 cy_rslt_t result = (cy_rslt_t)Cy_SCB_I2C_Init(obj->base, pdl_cfg, &(obj->context)); in _cyhal_i2c_init_hw()
354 uint8_t scb_arr_index = _cyhal_scb_get_block_index(obj->resource.block_num); in _cyhal_i2c_init_hw()
358 …_cyhal_scb_update_instance_data(obj->resource.block_num, (void*)obj, &_cyhal_i2c_pm_callback_insta… in _cyhal_i2c_init_hw()
361 Cy_SCB_I2C_Enable(obj->base); in _cyhal_i2c_init_hw()
363 Cy_SCB_I2C_Enable(obj->base, &(obj->context)); in _cyhal_i2c_init_hw()
365 obj->callback_data.callback = NULL; in _cyhal_i2c_init_hw()
366 obj->callback_data.callback_arg = NULL; in _cyhal_i2c_init_hw()
367 obj->addr_callback_data.callback = NULL; in _cyhal_i2c_init_hw()
368 obj->addr_callback_data.callback_arg = NULL; in _cyhal_i2c_init_hw()
369 obj->irq_cause = CYHAL_I2C_EVENT_NONE; in _cyhal_i2c_init_hw()
370 obj->addr_irq_cause = CYHAL_I2C_ADDR_EVENT_NONE; in _cyhal_i2c_init_hw()
373 … Cy_SCB_RegisterInterruptCallback(obj->base, _cyhal_irq_cb[_CYHAL_SCB_IRQ_N[scb_arr_index]]); in _cyhal_i2c_init_hw()
374 Cy_SCB_EnableInterrupt(obj->base); in _cyhal_i2c_init_hw()
384 __STATIC_INLINE uint32_t _cyhal_i2c_slave_status(cyhal_i2c_t *obj) in _cyhal_i2c_slave_status() argument
386 return Cy_SCB_I2C_SlaveGetStatus(obj->base, &obj->context); in _cyhal_i2c_slave_status()
389 __STATIC_INLINE void _cyhal_i2c_slave_clear_write_status(cyhal_i2c_t *obj) in _cyhal_i2c_slave_clear_write_status() argument
391 (void)Cy_SCB_I2C_SlaveClearWriteStatus(obj->base, &obj->context); in _cyhal_i2c_slave_clear_write_status()
394 __STATIC_INLINE void _cyhal_i2c_slave_clear_read_status(cyhal_i2c_t *obj) in _cyhal_i2c_slave_clear_read_status() argument
396 (void)Cy_SCB_I2C_SlaveClearReadStatus(obj->base, &obj->context); in _cyhal_i2c_slave_clear_read_status()
403 static cy_rslt_t _cyhal_i2c_slave_wait_for_status(cyhal_i2c_t *obj, uint32_t i2c_status, uint32_t t… in _cyhal_i2c_slave_wait_for_status() argument
408 if (!(obj->op_in_callback) && timeout > 0) in _cyhal_i2c_slave_wait_for_status()
410 while (0U == (_cyhal_i2c_slave_status(obj) & i2c_status) && timeout > 0) in _cyhal_i2c_slave_wait_for_status()
429 cy_rslt_t cyhal_i2c_init(cyhal_i2c_t *obj, cyhal_gpio_t sda, cyhal_gpio_t scl, const cyhal_clock_t … in cyhal_i2c_init() argument
431 CY_ASSERT(NULL != obj); in cyhal_i2c_init()
432 obj->dc_configured = false; in cyhal_i2c_init()
433 memset(obj, 0, sizeof(cyhal_i2c_t)); in cyhal_i2c_init()
435 cy_rslt_t result = _cyhal_i2c_init_resources(obj, sda, scl, clk); in cyhal_i2c_init()
438 result = _cyhal_i2c_init_hw(obj, &_cyhal_i2c_default_config); in cyhal_i2c_init()
442 cyhal_i2c_free(obj); in cyhal_i2c_init()
447 cy_rslt_t cyhal_i2c_init_cfg(cyhal_i2c_t *obj, const cyhal_i2c_configurator_t *cfg) in cyhal_i2c_init_cfg() argument
449 CY_ASSERT(NULL != obj); in cyhal_i2c_init_cfg()
453 memset(obj, 0, sizeof(cyhal_i2c_t)); in cyhal_i2c_init_cfg()
455 obj->dc_configured = true; in cyhal_i2c_init_cfg()
456 obj->resource = *cfg->resource; in cyhal_i2c_init_cfg()
457 obj->clock = *cfg->clock; in cyhal_i2c_init_cfg()
458 obj->is_clock_owned = false; in cyhal_i2c_init_cfg()
460 uint8_t scb_arr_index = _cyhal_scb_get_block_index(obj->resource.block_num); in cyhal_i2c_init_cfg()
461 obj->base = _CYHAL_SCB_BASE_ADDRESSES[scb_arr_index]; in cyhal_i2c_init_cfg()
463 return _cyhal_i2c_init_hw(obj, cfg->config); in cyhal_i2c_init_cfg()
466 void cyhal_i2c_free(cyhal_i2c_t *obj) in cyhal_i2c_free() argument
468 CY_ASSERT(NULL != obj); in cyhal_i2c_free()
470 if (NULL != obj->base) in cyhal_i2c_free()
472 Cy_SCB_I2C_Disable(obj->base, &obj->context); in cyhal_i2c_free()
473 Cy_SCB_I2C_DeInit(obj->base); in cyhal_i2c_free()
474 obj->base = NULL; in cyhal_i2c_free()
477 if (CYHAL_RSC_INVALID != obj->resource.type) in cyhal_i2c_free()
479 uint8_t scb_arr_index = _cyhal_scb_get_block_index(obj->resource.block_num); in cyhal_i2c_free()
480 _cyhal_scb_update_instance_data(obj->resource.block_num, NULL, NULL); in cyhal_i2c_free()
484 if (!obj->dc_configured) in cyhal_i2c_free()
486 …t_t rsc_to_free = { CYHAL_RSC_SCB, _cyhal_scb_get_block_index(obj->resource.block_num), obj->resou… in cyhal_i2c_free()
490 obj->resource.type = CYHAL_RSC_INVALID; in cyhal_i2c_free()
493 if (!obj->dc_configured) in cyhal_i2c_free()
495 _cyhal_utils_release_if_used(&(obj->pin_sda)); in cyhal_i2c_free()
496 _cyhal_utils_release_if_used(&(obj->pin_scl)); in cyhal_i2c_free()
498 if (obj->is_clock_owned) in cyhal_i2c_free()
500 cyhal_clock_free(&(obj->clock)); in cyhal_i2c_free()
505 cy_rslt_t cyhal_i2c_configure(cyhal_i2c_t *obj, const cyhal_i2c_cfg_t *cfg) in cyhal_i2c_configure() argument
507 CY_ASSERT(NULL != obj); in cyhal_i2c_configure()
518 return cyhal_i2c_configure_adv(obj, &adv_cfg); in cyhal_i2c_configure()
521 cy_rslt_t cyhal_i2c_configure_adv(cyhal_i2c_t *obj, const cyhal_i2c_adv_cfg_t *cfg) in cyhal_i2c_configure_adv() argument
523 CY_ASSERT(NULL != obj); in cyhal_i2c_configure_adv()
527 (void) Cy_SCB_I2C_Disable(obj->base, &obj->context); in cyhal_i2c_configure_adv()
544 cy_rslt_t result = (cy_rslt_t)Cy_SCB_I2C_Init(obj->base, &_config_structure, &(obj->context)); in cyhal_i2c_configure_adv()
548 uint32_t dataRate = _cyhal_i2c_set_peri_divider((void *)obj, true, in cyhal_i2c_configure_adv()
553 Cy_SCB_I2C_DeInit(obj->base); in cyhal_i2c_configure_adv()
559 (void) Cy_SCB_I2C_Enable(obj->base); in cyhal_i2c_configure_adv()
561 (void) Cy_SCB_I2C_Enable(obj->base, &(obj->context)); in cyhal_i2c_configure_adv()
567 cy_rslt_t cyhal_i2c_master_write(cyhal_i2c_t *obj, uint16_t dev_addr, const uint8_t *data, uint16_t… in cyhal_i2c_master_write() argument
572 cy_en_scb_i2c_status_t status = (obj->context.state == CY_SCB_I2C_IDLE) in cyhal_i2c_master_write()
573 … ? Cy_SCB_I2C_MasterSendStart(obj->base, dev_addr, CY_SCB_I2C_WRITE_XFER, timeout, &obj->context) in cyhal_i2c_master_write()
574 …: Cy_SCB_I2C_MasterSendReStart(obj->base, dev_addr, CY_SCB_I2C_WRITE_XFER, timeout, &obj->context); in cyhal_i2c_master_write()
580 status = Cy_SCB_I2C_MasterWriteByte(obj->base, *data, timeout, &obj->context); in cyhal_i2c_master_write()
594 Cy_SCB_I2C_MasterSendStop(obj->base, timeout, &obj->context); in cyhal_i2c_master_write()
600 cy_rslt_t cyhal_i2c_master_read(cyhal_i2c_t *obj, uint16_t dev_addr, uint8_t *data, uint16_t size, … in cyhal_i2c_master_read() argument
608 cy_en_scb_i2c_status_t status = obj->context.state == CY_SCB_I2C_IDLE in cyhal_i2c_master_read()
609 … ? Cy_SCB_I2C_MasterSendStart(obj->base, dev_addr, CY_SCB_I2C_READ_XFER, timeout, &obj->context) in cyhal_i2c_master_read()
610 … : Cy_SCB_I2C_MasterSendReStart(obj->base, dev_addr, CY_SCB_I2C_READ_XFER, timeout, &obj->context); in cyhal_i2c_master_read()
619 … status = Cy_SCB_I2C_MasterReadByte(obj->base, ack, (uint8_t *)data, timeout, &obj->context); in cyhal_i2c_master_read()
633 Cy_SCB_I2C_MasterSendStop(obj->base, timeout, &obj->context); in cyhal_i2c_master_read()
638 cy_rslt_t cyhal_i2c_slave_abort_read(cyhal_i2c_t *obj) in cyhal_i2c_slave_abort_read() argument
642 if (obj->context.state == CY_SCB_I2C_IDLE) in cyhal_i2c_slave_abort_read()
644 Cy_SCB_I2C_SlaveAbortRead(obj->base, &obj->context); in cyhal_i2c_slave_abort_read()
653 cy_rslt_t cyhal_i2c_slave_config_write_buffer(cyhal_i2c_t *obj, const uint8_t *data, uint16_t size) in cyhal_i2c_slave_config_write_buffer() argument
658 if (obj->context.state == CY_SCB_I2C_IDLE) in cyhal_i2c_slave_config_write_buffer()
660 Cy_SCB_I2C_SlaveConfigWriteBuf(obj->base, (uint8_t *)data, size, &obj->context); in cyhal_i2c_slave_config_write_buffer()
661 obj->rx_slave_buff.addr.u8 = (uint8_t *)data; in cyhal_i2c_slave_config_write_buffer()
662 obj->rx_slave_buff.size = size; in cyhal_i2c_slave_config_write_buffer()
673 cy_rslt_t cyhal_i2c_slave_config_read_buffer(cyhal_i2c_t *obj, uint8_t *data, uint16_t size) in cyhal_i2c_slave_config_read_buffer() argument
678 if (obj->context.state == CY_SCB_I2C_IDLE) in cyhal_i2c_slave_config_read_buffer()
680 Cy_SCB_I2C_SlaveConfigReadBuf(obj->base, (uint8_t *)data, size, &obj->context); in cyhal_i2c_slave_config_read_buffer()
681 obj->tx_slave_buff.addr.u8 = data; in cyhal_i2c_slave_config_read_buffer()
682 obj->tx_slave_buff.size = size; in cyhal_i2c_slave_config_read_buffer()
693 cy_rslt_t cyhal_i2c_master_mem_write(cyhal_i2c_t *obj, uint16_t address, uint16_t mem_addr, uint16_… in cyhal_i2c_master_mem_write() argument
713 …cy_rslt_t status = cyhal_i2c_master_write(obj, address, mem_addr_buf, mem_addr_size, timeout, fals… in cyhal_i2c_master_mem_write()
719 status = Cy_SCB_I2C_MasterWriteByte(obj->base, *data, timeout, &obj->context); in cyhal_i2c_master_mem_write()
729 Cy_SCB_I2C_MasterSendStop(obj->base, timeout, &obj->context); in cyhal_i2c_master_mem_write()
734 cy_rslt_t cyhal_i2c_master_mem_read(cyhal_i2c_t *obj, uint16_t address, uint16_t mem_addr, uint16_t… in cyhal_i2c_master_mem_read() argument
754 …cy_rslt_t status = cyhal_i2c_master_write(obj, address, mem_addr_buf, mem_addr_size, timeout, fals… in cyhal_i2c_master_mem_read()
757 status = cyhal_i2c_master_read(obj, address, data, size, timeout, true); in cyhal_i2c_master_mem_read()
762 cy_rslt_t cyhal_i2c_slave_read(cyhal_i2c_t *obj, uint8_t *dst_buff, uint16_t *size, uint32_t timeou… in cyhal_i2c_slave_read() argument
766 if (obj->rx_slave_buff.addr.u8 == NULL) in cyhal_i2c_slave_read()
773 status = _cyhal_i2c_slave_wait_for_status(obj, CY_SCB_I2C_SLAVE_WR_CMPLT, timeout); in cyhal_i2c_slave_read()
777 *size = _CYHAL_SCB_BYTES_TO_COPY(cyhal_i2c_slave_readable(obj), *size); in cyhal_i2c_slave_read()
779 if (obj->rx_slave_buff.addr.u8 != dst_buff) in cyhal_i2c_slave_read()
782 (void) memcpy((void *)dst_buff, (const void *)obj->rx_slave_buff.addr.u8, *size); in cyhal_i2c_slave_read()
786 while (obj->context.state != CY_SCB_I2C_IDLE && !(obj->op_in_callback)) in cyhal_i2c_slave_read()
792 _cyhal_i2c_slave_clear_write_status(obj); in cyhal_i2c_slave_read()
798 cy_rslt_t cyhal_i2c_slave_write(cyhal_i2c_t *obj, const uint8_t *src_buff, uint16_t *size, uint32_t… in cyhal_i2c_slave_write() argument
802 if (obj->tx_slave_buff.addr.u8 == NULL) in cyhal_i2c_slave_write()
809 while (obj->context.state != CY_SCB_I2C_IDLE && !(obj->op_in_callback)) in cyhal_i2c_slave_write()
815 if (obj->context.state == CY_SCB_I2C_IDLE) in cyhal_i2c_slave_write()
817 *size = _CYHAL_SCB_BYTES_TO_COPY(obj->tx_slave_buff.size, *size); in cyhal_i2c_slave_write()
819 if (obj->tx_slave_buff.addr.u8 != src_buff) in cyhal_i2c_slave_write()
822 (void) memcpy((void *)obj->tx_slave_buff.addr.u8, (const void *)src_buff, *size); in cyhal_i2c_slave_write()
826 status = _cyhal_i2c_slave_wait_for_status(obj, CY_SCB_I2C_SLAVE_RD_CMPLT, timeout); in cyhal_i2c_slave_write()
829 _cyhal_i2c_slave_clear_read_status(obj); in cyhal_i2c_slave_write()
836 cy_rslt_t cyhal_i2c_master_transfer_async(cyhal_i2c_t *obj, uint16_t address, const void *tx, size_… in cyhal_i2c_master_transfer_async() argument
841 obj->rx_config.slaveAddress = (uint8_t)address; in cyhal_i2c_master_transfer_async()
842 obj->tx_config.slaveAddress = (uint8_t)address; in cyhal_i2c_master_transfer_async()
844 obj->rx_config.buffer = rx; in cyhal_i2c_master_transfer_async()
845 obj->rx_config.bufferSize = rx_size; in cyhal_i2c_master_transfer_async()
847 obj->tx_config.buffer = (void *)tx; in cyhal_i2c_master_transfer_async()
848 obj->tx_config.bufferSize = tx_size; in cyhal_i2c_master_transfer_async()
850 if (!obj->pending) in cyhal_i2c_master_transfer_async()
855 obj->pending = (rx_size) in cyhal_i2c_master_transfer_async()
858 Cy_SCB_I2C_MasterWrite(obj->base, &obj->tx_config, &obj->context); in cyhal_i2c_master_transfer_async()
863 obj->pending = _CYHAL_I2C_PENDING_RX; in cyhal_i2c_master_transfer_async()
864 Cy_SCB_I2C_MasterRead(obj->base, &obj->rx_config, &obj->context); in cyhal_i2c_master_transfer_async()
878 cy_rslt_t cyhal_i2c_abort_async(cyhal_i2c_t *obj) in cyhal_i2c_abort_async() argument
881 if (obj->pending != _CYHAL_I2C_PENDING_NONE) in cyhal_i2c_abort_async()
883 if (obj->pending == _CYHAL_I2C_PENDING_RX) in cyhal_i2c_abort_async()
885 Cy_SCB_I2C_MasterAbortRead(obj->base, &obj->context); in cyhal_i2c_abort_async()
889 Cy_SCB_I2C_MasterAbortWrite(obj->base, &obj->context); in cyhal_i2c_abort_async()
893 while ((CY_SCB_I2C_MASTER_BUSY & obj->context.masterStatus) && (timeout_us != 0)) in cyhal_i2c_abort_async()
902 obj->pending = _CYHAL_I2C_PENDING_NONE; in cyhal_i2c_abort_async()
907 void cyhal_i2c_register_callback(cyhal_i2c_t *obj, cyhal_i2c_event_callback_t callback, void *callb… in cyhal_i2c_register_callback() argument
910 obj->callback_data.callback = (cy_israddress) callback; in cyhal_i2c_register_callback()
911 obj->callback_data.callback_arg = callback_arg; in cyhal_i2c_register_callback()
913 Cy_SCB_I2C_RegisterEventCallback(obj->base, _cyhal_i2c_cb_wrapper, &(obj->context)); in cyhal_i2c_register_callback()
915 obj->irq_cause = CYHAL_I2C_EVENT_NONE; in cyhal_i2c_register_callback()
918 void cyhal_i2c_register_address_callback(cyhal_i2c_t *obj, cyhal_i2c_address_callback_t callback, v… in cyhal_i2c_register_address_callback() argument
921 obj->addr_callback_data.callback = (cy_israddress) callback; in cyhal_i2c_register_address_callback()
922 obj->addr_callback_data.callback_arg = callback_arg; in cyhal_i2c_register_address_callback()
924 Cy_SCB_I2C_RegisterAddrCallback(obj->base, _cyhal_i2c_cb_addr_wrapper, &(obj->context)); in cyhal_i2c_register_address_callback()
926 obj->addr_irq_cause = CYHAL_I2C_ADDR_EVENT_NONE; in cyhal_i2c_register_address_callback()
929 void cyhal_i2c_enable_event(cyhal_i2c_t *obj, cyhal_i2c_event_t event, uint8_t intr_priority, bool … in cyhal_i2c_enable_event() argument
931 uint8_t scb_arr_index = _cyhal_scb_get_block_index(obj->resource.block_num); in cyhal_i2c_enable_event()
934 obj->irq_cause |= event; in cyhal_i2c_enable_event()
938 obj->irq_cause &= ~event; in cyhal_i2c_enable_event()
945 void cyhal_i2c_enable_address_event(cyhal_i2c_t *obj, cyhal_i2c_addr_event_t event, uint8_t intr_pr… in cyhal_i2c_enable_address_event() argument
947 uint8_t scb_arr_index = _cyhal_scb_get_block_index(obj->resource.block_num); in cyhal_i2c_enable_address_event()
950 obj->addr_irq_cause |= event; in cyhal_i2c_enable_address_event()
954 obj->addr_irq_cause &= ~event; in cyhal_i2c_enable_address_event()
961 cy_rslt_t cyhal_i2c_set_fifo_level(cyhal_i2c_t *obj, cyhal_i2c_fifo_type_t type, uint16_t level) in cyhal_i2c_set_fifo_level() argument
963 return _cyhal_scb_set_fifo_level(obj->base, (cyhal_scb_fifo_type_t)type, level); in cyhal_i2c_set_fifo_level()
966 cy_rslt_t cyhal_i2c_enable_output(cyhal_i2c_t *obj, cyhal_i2c_output_t output, cyhal_source_t *sour… in cyhal_i2c_enable_output() argument
968 return _cyhal_scb_enable_output(obj->resource, (cyhal_scb_output_t)output, source); in cyhal_i2c_enable_output()
971 cy_rslt_t cyhal_i2c_disable_output(cyhal_i2c_t *obj, cyhal_i2c_output_t output) in cyhal_i2c_disable_output() argument
973 CY_UNUSED_PARAMETER(obj); in cyhal_i2c_disable_output()
977 uint32_t cyhal_i2c_slave_readable(cyhal_i2c_t *obj) in cyhal_i2c_slave_readable() argument
979 return Cy_SCB_I2C_SlaveGetWriteTransferCount(obj->base, &obj->context); in cyhal_i2c_slave_readable()
982 uint32_t cyhal_i2c_slave_writable(cyhal_i2c_t *obj) in cyhal_i2c_slave_writable() argument
984 … return (obj->tx_slave_buff.size - Cy_SCB_I2C_SlaveGetReadTransferCount(obj->base, &obj->context)); in cyhal_i2c_slave_writable()
987 cy_rslt_t cyhal_i2c_clear(cyhal_i2c_t *obj) in cyhal_i2c_clear() argument
989 Cy_SCB_ClearRxFifo(obj->base); in cyhal_i2c_clear()
990 Cy_SCB_ClearTxFifo(obj->base); in cyhal_i2c_clear()
992 _cyhal_i2c_slave_clear_write_status(obj); in cyhal_i2c_clear()
993 _cyhal_i2c_slave_clear_read_status(obj); in cyhal_i2c_clear()