Pycardium: Use sleep API call while sleeping

Merged schneider requested to merge schneider/pycardium-api-sleep into master

Based on !475 (merged) which should be merged first.

This allows pycardium to signal epicardium that it is ready to sleep and that the system can reduce power consumption by going to a light sleep mode.

At the moment it increases interrupt latency on pycardium side from 1 ms to around 100 ms. I'll try in a next step to reduce that and break the sleep on epicardium side earlier if that happens. Not sure if this has any noticeable impact on behaviour though.

Edited by schneider

Merge request reports