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

Where is I2C code? #1

Closed
seamusdemora opened this issue Mar 10, 2025 · 4 comments
Closed

Where is I2C code? #1

seamusdemora opened this issue Mar 10, 2025 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@seamusdemora
Copy link

Hello,

I'm looking for a non-Arduino library for the RV3028. Your repo seems to provide that, but when I looked through the source code I couldn't find any reference to I2C interface?? There is a bit in rtc_rv3028.h that has a #include <inttypes.h>... I thought it might be in there, but that file wasn't included.

I'm looking for a general library that I can use with a uController... maybe this isn't what I'm looking for??

Thanks for your time,
~Seamus

@gfcwfzkm gfcwfzkm self-assigned this Mar 11, 2025
@gfcwfzkm
Copy link
Owner

Hi!

This is indeed a non-repo library for the RV3028 RTC chip. There is a I2C interface that has to be initialized first before using the library. Since I have written the library as generic as possible (so without any ties to any specific microcontroller or architecture), it doesn't know the I2C functions by default. You need to pass your I2C functions as a function pointer to the function rv3028_initStruct.

The Readme has a example where this is done. If you want to know how these I2C functions are implemented, please take a look at INTERFACE.md for the general I/O interface idea I am using in my libraries as well as a example implementation for a RISC-V microcontroller.

If you have any additional questions, feel free to bring them :)
~gfc

@gfcwfzkm gfcwfzkm added the documentation Improvements or additions to documentation label Mar 11, 2025
@seamusdemora
Copy link
Author

If you have any additional questions, feel free to bring them :)

Hey! Thanks for the follow-up. I've just read this, and haven't looked at INTERFACE.md yet, but one question has "popped up": The 'generic' approach makes sense to me (not being proficient in C); but does this mean that I could use the i2ctools utilities (i.e. i2cget and i2cset) for that?

@gfcwfzkm
Copy link
Owner

I'm not familiar with these tools but I know that it should work under linux using the i2c-dev libraries. You just need to write a little wrapper functions that make the connection between my interface and the i2c-dev's I2C interface.

@seamusdemora
Copy link
Author

I'm not familiar with these tools but I know that it should work under linux using the i2c-dev libraries. You just need to write a little wrapper functions that make the connection between my interface and the i2c-dev's I2C interface.

That will help! I'll follow up if I have questions... and thanks!

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

No branches or pull requests

2 participants