COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
CPU.hh
Go to the documentation of this file.
1
21
#ifndef COSA_CPU_HH
22
#define COSA_CPU_HH
23
24
#include "
Cosa/Types.h
"
25
29
class
CPU
{
30
public
:
38
static
uint8_t
clock_prescale
(uint8_t factor)
39
{
40
if
(
UNLIKELY
(factor > 4)) factor = 4;
41
uint8_t res = CLKPR;
42
synchronized
{
43
CLKPR = _BV(CLKPCE);
44
CLKPR = factor;
45
}
46
return
(res);
47
}
48
54
static
uint32_t
clock_freq
()
55
{
56
return
(F_CPU >> CLKPR);
57
}
58
59
private
:
63
CPU
() {}
64
};
65
66
#endif
Types.h
CPU::clock_freq
static uint32_t clock_freq()
Definition:
CPU.hh:54
CPU::clock_prescale
static uint8_t clock_prescale(uint8_t factor)
Definition:
CPU.hh:38
CPU
Definition:
CPU.hh:29
UNLIKELY
#define UNLIKELY(x)
Definition:
Types.h:153
cores
cosa
Cosa
CPU.hh
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11