Skip to content
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

General I2C questions #2606

Open
MaBecker opened this issue Feb 1, 2025 · 3 comments
Open

General I2C questions #2606

MaBecker opened this issue Feb 1, 2025 · 3 comments
Labels

Comments

@MaBecker
Copy link
Contributor

MaBecker commented Feb 1, 2025

On my way to implement a CST816S i2c touch device for a custom board.

Is there a implementation like function I2C.readReg(address, reg, quantity) we can use in c instead of a jsi2cWrite() used with jsi2cRead()

#define CST816S_ID 0x15

unsigned char buf[6];
uint8_t version;
// read version
    buf[0] = 0x15; jsi2cWrite(&jswrap_touch_init, CST816S_ID, 1, buf, true);
    // wait 100ms
    jshDelayMicroseconds(100*1000); // we should really have a callback
    jsi2cRead(&jswrap_touch_init, CST816S_ID, 1, &version, true);

@SimonGAndrews
Copy link
Contributor

There may be some ideas here.
This link
And the supporting module http://www.espruino.com/modules/PCA9685.js have some examples of setting up a device via its registers. That may help.

@SimonGAndrews
Copy link
Contributor

But your probably familiar with those @MaBecker ??

@MaBecker
Copy link
Contributor Author

MaBecker commented Feb 1, 2025

Thanks for picking this up. Yes
This a question about firmware code in c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants