Hi,
I have 2 spi sensors which operates in spi mode 0 and mode1. i want to connect the 2 sensors to a single spi lines by sharing the lines. so is there a way i can switch between the modes while in run time. ie make mode 0 and read dfrom sensor 0 and then switch mode to 1 and read sensor1 data.
i have tried this with arduino library and it is working but couldn't figure it out with esp-idf.
what would be the best way to read from both sensors?
switch spi mode at run time
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: switch spi mode at run time
You can set the SPI mode per device if you use the ESP-IDF SPI driver. The driver will handle switching for you.
-
- Posts: 2
- Joined: Wed Jun 19, 2019 4:25 pm
Re: switch spi mode at run time
Hi sprite,
Thanks for the quick reply, it is working.
Thanks for the quick reply, it is working.
Who is online
Users browsing this forum: No registered users and 137 guests