#include <SFBProcessor.h>
Public Member Functions | |
void | setMaxSpeed () |
Change the CPU clock to its fastest-computing (most power-consuming) available value. | |
void | setMinSpeed () |
Change the CPU clock to its most power-conserving (slowest-computing) available value. | |
u32 | getMHzMin () |
Return the slowest supported CPU clock speed, in millions of cycles-per-second. | |
u32 | getCodeMin () |
Return the slowest supported CPU clock speed, as a 'CPU Speed Code'. | |
u32 | getMHzMax () |
Return the fastest supported CPU clock speed, in millions of cycles-per-second. | |
u32 | getCodeMax () |
Return the fastest supported CPU clock speed, as a 'CPU Speed Code'. | |
u32 | getHz () |
Return the current CPU clock speed in cycles-per-second. | |
u32 | getMHz () |
Return the current CPU clock speed in millions of cycles-per-second. | |
u32 | getCode () |
Return the current CPU clock speed as a 'CPU Speed Code'. | |
void | setHz (u32 hz) |
Change the clock speed to hz cycles-per-second, or to the next lower available value, if hz is not an exactly supported value. | |
void | setMHz (u32 mhz) |
Change the clock speed to mhz million cycles-per-second, or to the next lower available value, if mhz is not an exactly supported value. | |
void | setCode (u32 code) |
Change the clock speed to that specified by code. |
u32 SFBProcessor::getCode | ( | ) |
u32 SFBProcessor::getCodeMax | ( | ) | [inline] |
Return the fastest supported CPU clock speed, as a 'CPU Speed Code'.
Currently the fastest possible speed code is CSC_72MHZ.
u32 SFBProcessor::getCodeMin | ( | ) | [inline] |
Return the slowest supported CPU clock speed, as a 'CPU Speed Code'.
Currently the slowest possible speed code is CSC_12MHZ.
u32 SFBProcessor::getHz | ( | ) | [inline] |
Return the current CPU clock speed in cycles-per-second.
u32 SFBProcessor::getMHz | ( | ) | [inline] |
Return the current CPU clock speed in millions of cycles-per-second.
u32 SFBProcessor::getMHzMax | ( | ) | [inline] |
Return the fastest supported CPU clock speed, in millions of cycles-per-second.
Currently the fastest possible speed is 72MHz.
u32 SFBProcessor::getMHzMin | ( | ) | [inline] |
Return the slowest supported CPU clock speed, in millions of cycles-per-second.
Currently the slowest possible speed is 12MHz.
void SFBProcessor::setCode | ( | u32 | code | ) |
Change the clock speed to that specified by code.
Higher speed codes (e.g., CSC_72MHZ) compute faster; lower speed codes (e.g., CSC_12MHZ) save power.
Although time-based calls such as millis(), micros(), and delay() are essentially unaffected by processor speed changes, one must be sensitive to the obvious and inescapable fact that at slower speeds computing stuff just takes longer. If you explore with the Profile object, for example, at slower speeds you'll see interrupt overhead, as well as alarm and packet handlers, eating more and more time.
And beyond that, sketch programmers must also be aware of these important less obvious limitations and warnings about changing the CPU speed:
void SFBProcessor::setHz | ( | u32 | hz | ) | [inline] |
Change the clock speed to hz cycles-per-second, or to the next lower available value, if hz is not an exactly supported value.
Higher speeds compute faster; lower speeds save power. See notes at setCode for implications of speed changes.
void SFBProcessor::setMaxSpeed | ( | ) | [inline] |
Change the CPU clock to its fastest-computing (most power-consuming) available value.
See also setMinSpeed. See notes at setCode for possible implications of speed changes.
void SFBProcessor::setMHz | ( | u32 | mhz | ) | [inline] |
Change the clock speed to mhz million cycles-per-second, or to the next lower available value, if mhz is not an exactly supported value.
Higher speeds compute faster; lower speeds save power. See notes at setCode for implications of speed changes.
void SFBProcessor::setMinSpeed | ( | ) | [inline] |
Change the CPU clock to its most power-conserving (slowest-computing) available value.
See also setMaxSpeed. See notes at setCode for possible implications of speed changes.