zephyr
zephyr copied to clipboard
stm32: Add support for serial PM actions and wakeup support
This PR adds support and demonstrates use of serial PM actions and use of serial as wakeup source
Points of attention on feature implementation in usart_stm32.c
- A new config field
wakeup_sourceis added. This is redundant withpm_deviceAPI's flagPM_DEVICE_FLAG_WS_CAPABLE. Reason is that wakeup capability should actually be available withCONFIG_PMwhilePM_DEVICE_FLAG_WS_CAPABLEare only available ifCONFIG_PM_DEVICEis enabled. In order to simplify driver code, it is kept even ifCONFIG_PM_DEVICEis enabled. But in this case,pm_device_wakeup_enableAPIs prevails. - In treatment of
PM_ACTION_SUSPEND, if peripheral is not configured with a "sleep" pinctrl state, a warning is generated, but this doesn't prevent core transition to low power PM state. See dedicated commit for more details
^^@r2r0