Hi Dialog,
There are two devices connecting with DA14681 by one SPI interface in my project, but the voltage levels of the two interfaces are different, 1.8v and 3.3v respectively.
So I want to configure the corresponding power source(1.8 or 3.3v) in the SPI interface when I choose to communicate with one of the two( share one SPI interface of DA14681). Is it possible to change the power source after periph_init() is done? If yes, how to implement this ?
I tried to configure as 1.8v before communicating with 1.8v device, but the pin outputs are still 3.3v.(initial power source is 3.3v) thanks for your help.
Device:
Hi nigelyang,
For this kind of functionality there is an available API, which called hw_gpio_configure_pin_power() and it is included into the hw_gpio.h library. So, when you would like to switch the power rail of the GPIOs you should call this API.
Thanks, PM_Dialog
hi Dialog,
I did configuration by hw_gpio_configure_pin_power()! If I did it outside periph_init(), the result is failed, and if done in periph_init(), the result is successful. What setting do I miss during power source configuration so that I can change the pin voltage level in a task? thanks for your answer.
Hi nigelyang,
Could you please call the periph_init every time that you change the voltage levels?
Thanks, PM_Dialog