- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
[WIP] add power management to the stm32 spi driver #32544
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
Conversation
This will activate the LPTIM for the test sequence once the power management is enabled Signed-off-by: Francois Ramu <[email protected]>
This sample uses the lptim when calling the k_sleep for the STM32xx from STMicroelectronics. Using new DT for button and Led, Button is ready to exit from low power state. Signed-off-by: Francois Ramu <[email protected]>
Signed-off-by: Francois Ramu <[email protected]>
This sample uses is demonstrating the spi transfer followed by a low power period. The lptim is the timer to program the low power mode. The button is ready to exit from low power state. Signed-off-by: Francois Ramu <[email protected]>
|  | ||
| /* Configure LEDs */ | ||
| gpio_led = device_get_binding(LED0); | ||
| if (gpio_led == NULL) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can assert here, or log the error, otherwise it will silent fail what is not that helpful.
| This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. | 
With this change, the spi driver of the stm32 soc, is prepared to enter/exit the low power mode.
The SPI executes the
spi_stm32_set_power_statefrom thespi_stm32_pm_controlto have a clean configuration before entering/exiting the low power mode.This is the case with stm32wb55 and stm32l47 as first targets devices, which are using the lptimer.
On wakeup, the clocks are re-configured thanks to the stm32_clock_control_init function called directly in the
pm_power_state_exit_post_ops of each soc.
This method is similar to what was done on the UART.
A new sample application is added to demonstrate the operations on the SPI driver.
Signed-off-by: Francois Ramu [email protected]