Typo in I2C "Get Slave Events Notification" example in the Cypress Peripheral Driver Library Version 3.0.1.1508

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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 */

}

0 Likes
1 Solution
JamesT_21
Moderator
Moderator
Moderator
10 solutions authored 5 solutions authored First solution authored

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

View solution in original post

0 Likes
2 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

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?

0 Likes
JamesT_21
Moderator
Moderator
Moderator
10 solutions authored 5 solutions authored First solution authored

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

0 Likes