From 88d3054ac072f9c73b0f3f045c59ba74f6730c1d Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 31 Oct 2014 01:37:19 +0000 Subject: docs: Import documentation from source-code inline comments. The inline docs (prefixed with /// in .c files) have been converted to RST format and put in the docs subdirectory. --- docs/tutorial/power_ctrl.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/tutorial/power_ctrl.rst (limited to 'docs/tutorial/power_ctrl.rst') diff --git a/docs/tutorial/power_ctrl.rst b/docs/tutorial/power_ctrl.rst new file mode 100644 index 000000000..877b7cd7e --- /dev/null +++ b/docs/tutorial/power_ctrl.rst @@ -0,0 +1,13 @@ +Power control +============= + +:meth:`pyb.wfi` is used to reduce power consumption while waiting for an +event such as an interrupt. You would use it in the following situation:: + + while True: + do_some_processing() + pyb.wfi() + +Control the frequency using :meth:`pyb.freq`:: + + pyb.freq(30000000) # set CPU frequency to 30MHz -- cgit v1.2.3