Skip to content

driver: i2c: cc13xx_cc26xx: to support i2c scan #38584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions drivers/i2c/i2c_cc13xx_cc26xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,20 @@ static int i2c_cc13xx_cc26xx_transmit(const struct device *dev,
const uint32_t base = get_dev_config(dev)->base;
struct i2c_cc13xx_cc26xx_data *data = get_dev_data(dev);

/* Sending address without data is not supported */
Copy link
Member

@cfriedt cfriedt Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* Sending address without data is not supported */

I'm not 100% convinced that this statement is true, as I'm sure is the case for everyone else working with this SoC.

Let's ask the contributor with arguably the most experience with the vendor API in question.

@vanti - is there a way to perform an I2C scan / probe using the simplelink I2C driverlib? I.e. sending the address bits without sending data bits (with some indication as to whether the connected peripheral has ACK'ed the address bits). If so, how do we do it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pillar1989, @Vaishnav98 - given what everyone else has said, I think we may not find the answer in the SimpleLink SDK. However, i sort of wonder if this could be bit-banged 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfriedt @stephanosio Assume that we need to add more code to i2c scan to support some SoC like CC13xx serial. any suggest? Or maybe this is a half-baked idea, and we still need to fix the problem of sending only addresses.

I2CMasterSlaveAddrSet(base, addr, false);

/* Sending address without data is not supported, for `i2c scan` or other
* function still neeed send i2c address check the device status.
*/
if (len == 0) {
return -EIO;

I2CMasterControl(base, I2C_MASTER_CMD_SINGLE_SEND);

k_sem_take(&data->complete, K_FOREVER);

return data->error == I2C_MASTER_ERR_NONE ? 0 : -EIO;
}

I2CMasterSlaveAddrSet(base, addr, false);

/* The following assumes a single master. Use I2CMasterBusBusy() if
* wanting to implement multiple master support.
Expand Down