Q1 : do i need special conciduration in PD stack ?
>> You are not any special conciduration in PD stack, since the I2C transitions should be not block any PD stack in the firmware side.
Q2 : why need delay in slave code all examples show with delay ?
>> Recommend you use polling way or set I2C slave as FIFO (Ez I2C) and check the contents of FIFO each while loop (500ms). The I2C slave handle call back should be add into the app_task(port), and you also should register I2C wake up in the deep_sleep wake up functions.
Q3 : how hanle slave i2c in power adapter project
>> Slave I2C should have register define, you should monitor the changes of registers and define the call backs for this.
Q2 response :
i dont have option Ez I2C in power adpater project only SCB
could you give exmaple how add callback to the app_task or pdf which explain how also about deepsleep handle it will be usefull to other features in the project
void cypd3175_timer_cb (
//uint8_t srv_reg_add=0x04,src_reg_add=0x05,sinf_add_reg=0x02; // uint8_t , fw_ver_add_reg=0x00,
if (TRANSFER_CMPLT == cypd3175_write_register(I2C_SLAVE_ADDR,&sinf_add_reg))
if (TRANSFER_CMPLT == cypd3175_read_reagister(I2C_SLAVE_ADDR,cypd3175_buffer,len_packet))
cypd_resualt=((uint16_t)cypd3175_buffer << 8) | cypd3175_buffer;
WEIZ_DEBUG_PRINT(WZ_GENERAL_PURPOSE, "[%s] SNIF %2x \r\n", __func__,cypd_resualt);
gpio_set_value (FW_LED_RED_GPIO_PORT_PIN, !(gpio_read_value (FW_LED_RED_GPIO_PORT_PIN)));
timer_start (0, CYPD3175_TIMER_ID, CYPD3175_TIMER_PERIOD, cypd3175_timer_cb);
the fw stack not send any transaction to slave
any response to this case ?
I would like to recommend you refer our EZ-PD host SDK which have many I2C operations includes I2C master and I2C slave, you could take a look and refer it.
For example, the I2C transmits prefer to add into application layer --- app.c.
Latest Host SDK download: https://www.cypress.com/documentation/software-and-drivers/ez-pd-host-software-development-kit
And you are on the right way, I2C example code can be download with PSoC Creator.
any progress with answer to my question could you provide specific project where i could find implement i2c in app callback i send you screen shot could you tell me
any respond to my quastion which project from host sdk show usage i2c in app callback ?
could you please send me example on host sdk
I2C Slave SCB block usage byte level APIs
i didnt find any example of slave only master