-
Notifications
You must be signed in to change notification settings - Fork 1
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
optional interrupts and more #2
base: main
Are you sure you want to change the base?
Conversation
Added the ability to use or not interrupts for all conversions. streamlined the logic that checks for end of conversion for all functions. replaced the custom delay function with the freertos one. We could make this optional but when running on freertos, its better to use vTaskDelay to yield the processor.
Hi @Vigeant Sorry for the delay in updating the driver, I've been using the new ESP-IDF i2c driver for a while now, but I forgot to push it. I just updated it, it also works with interrupts, which is the way I use it. Anyway, I'll keep an eye on your work and your suggestions to improve this driver, thanks a lot! To initialize the driver in interrupt mode use the next code
|
Hi Mauricio, your last commit has no changes from the previous.
…On Wed, Jan 22, 2025, 10:49 p.m. Mauricio Barroso Benavides < ***@***.***> wrote:
Hi @Vigeant <https://github.com/Vigeant> Sorry for the delay in updating
the driver, I've been using the new ESP-IDF i2c driver for a while now, but
I forgot to push it. I just updated it, it also works with interrupts,
which is the way I use it. Anyway, I'll keep an eye on your work and your
suggestions to improve this driver, thanks a lot!
To initialize the driver in interrupt mode use the next code
ret = ads101x_init(&me->adc, ADS101X_MODEL_5, int_pin, i2c_bus_handle, ADS101X_I2C_ADDRESS);
if (ret != ESP_OK) {
return ESP_FAIL;
}
ads101x_set_gain(&me->adc, ADS101X_GAIN_ONE);
ads101x_set_data_rate(&me->adc, ADS101X_DATA_RATE_3300SPS);
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIRPK7YLYZYWHNE7EX4W532MBRDRAVCNFSM6AAAAABVWLZ4MSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYG44TCNBQGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Also I closed the issue as you were actually using the new driver but still
had a reference to the old in your makefile
On Wed, Jan 22, 2025, 10:59 p.m. Guillaume Vigeant <
***@***.***> wrote:
… Hi Mauricio, your last commit has no changes from the previous.
On Wed, Jan 22, 2025, 10:49 p.m. Mauricio Barroso Benavides <
***@***.***> wrote:
> Hi @Vigeant <https://github.com/Vigeant> Sorry for the delay in updating
> the driver, I've been using the new ESP-IDF i2c driver for a while now, but
> I forgot to push it. I just updated it, it also works with interrupts,
> which is the way I use it. Anyway, I'll keep an eye on your work and your
> suggestions to improve this driver, thanks a lot!
>
> To initialize the driver in interrupt mode use the next code
>
> ret = ads101x_init(&me->adc, ADS101X_MODEL_5, int_pin, i2c_bus_handle, ADS101X_I2C_ADDRESS);
>
> if (ret != ESP_OK) {
> return ESP_FAIL;
> }
>
> ads101x_set_gain(&me->adc, ADS101X_GAIN_ONE);
> ads101x_set_data_rate(&me->adc, ADS101X_DATA_RATE_3300SPS);
>
> —
> Reply to this email directly, view it on GitHub
> <#2 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABIRPK7YLYZYWHNE7EX4W532MBRDRAVCNFSM6AAAAABVWLZ4MSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYG44TCNBQGQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@Vigeant Sorry, you're right, I didn't realize I still had that remnant of my own i2c bus driver. I've already corrected it, thanks for noticing. |
Thanks for the driver man. You saved me a ton of time. I made some changes to make interupt optional as all I have going to my adc1015 is i2c.
Feel free to refuse or heavily tweak this PR as I did add an include for FreeRTOS which works in my project but not sure its done right.
Added the ability to use or not interrupts for all conversions. streamlined the logic that checks for end of conversion for all functions. replaced the custom delay function with the freertos one. We could make this optional but when running on freertos, its better to use vTaskDelay to yield the processor.
Also, should consider blocking on a mutex instead of busy waiting when using interupts as it would also allow yielding the processor until the mutex is released by the isr.