- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There appears to be a typo in the "Get Slave Events Notification" example. CY_SCB_I2C_SLAVE_RD_CMPLT_EVENT should be CY_SCB_I2C_SLAVE_WR_CMPLT_EVENT for the write event.
/* Callback implementation */
void I2C_SlaveEventHandler(uint32_t events)
{
/* Slave sent data to master */
if (0UL != (events & CY_SCB_I2C_SLAVE_RD_CMPLT_EVENT))
{
if (0UL == (events & CY_SCB_I2C_SLAVE_ERR_EVENT))
{
/* Read complete without errors: update buffer content */
}
/* Setup read buffer for the next read transaction */
Cy_SCB_I2C_SlaveConfigReadBuf(SCB3, i2cReadBuffer, BUFFER_SIZE, &i2cContext);
}
/* Slave received data from master */
if (0UL != (events & CY_SCB_I2C_SLAVE_RD_CMPLT_EVENT)) // Should be CY_SCB_I2C_SLAVE_WR_CMPLT_EVENT
{
if (0UL == (events & CY_SCB_I2C_SLAVE_ERR_EVENT))
{
/* Write complete without errors: Process received data */
}
/* Setup buffer for the next write transaction */
Cy_SCB_I2C_SlaveConfigWriteBuf(SCB3, i2cWriteBuffer, BUFFER_SIZE, &i2cContext);
}
/* Ignore all other events */
}
Solved! Go to Solution.
- Tags:
- pdl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aha! I figured out what you're referencing, it's the code snippet in the I2C overview in the API reference documentation.
The API documentation file is (I'm looking at 3.0.2, and the same issue is there)
file:///C:/Program%20Files%20(x86)/Cypress/PDL/3.0.2/doc/pdl_api_reference_manual/html/group__group__scb__i2c.html
I'll report it. Thanks for the heads up.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems no API named I2C_SlaveEventHandler() in PDL for SCB driver. Can you please let me know the specific location of file where the API exists?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aha! I figured out what you're referencing, it's the code snippet in the I2C overview in the API reference documentation.
The API documentation file is (I'm looking at 3.0.2, and the same issue is there)
file:///C:/Program%20Files%20(x86)/Cypress/PDL/3.0.2/doc/pdl_api_reference_manual/html/group__group__scb__i2c.html
I'll report it. Thanks for the heads up.
Jim