COSA
An Object-Oriented Platform for Arduino Programming
CPU Class Reference

#include <CPU.hh>

Collaboration diagram for CPU:
Collaboration graph

Static Public Member Functions

static uint8_t clock_prescale (uint8_t factor)
 
static uint32_t clock_freq ()
 

Detailed Description

Processor frequency scaling and support functions.

Definition at line 29 of file CPU.hh.

Member Function Documentation

static uint32_t CPU::clock_freq ( )
inlinestatic

Returns current processor clock frequency. May be used instead of F_CPU to adjust after prescaling.

Returns
processor clock frequency

Definition at line 54 of file CPU.hh.

static uint8_t CPU::clock_prescale ( uint8_t  factor)
inlinestatic

Scale the clock frequency according to the give prescale factor (0..4 for prescale pow2(factor) 1..16). Returns previous prescale factor.

Parameters
[in]prescaledivision factor (0..4).
Returns
previous prescale factor.

Definition at line 38 of file CPU.hh.


The documentation for this class was generated from the following file: