forked from telamon/ArduinoDSP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimers.h
More file actions
32 lines (25 loc) · 777 Bytes
/
timers.h
File metadata and controls
32 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#define pwm3 OCR2B
#define pwm5 OCR0B
#define pwm6 OCR0A
#define pwm9 OCR1A
#define pwm10 OCR1B
#define pwm11 OCR2A
int getTimer(int pin);
int getChannel(int pin);
// - - -- timer settings
#define phaseCorrect 0
#define fastPWM 1
void waveformGenerationMode(int pin, int type);
void waveformGenerationMode(int pin, int type, int bits); // pins 9 and 10
void timerPrescale(int pin, int prescale);
int getPrescale01(int prescale);
int getPrescale2(int prescale);
// - - -- analog prescaling
#define analogPrescale2 B001
#define analogPrescale4 B010
#define analogPrescale8 B011
#define analogPrescale16 B100
#define analogPrescale32 B101
#define analogPrescale64 B110
#define analogPrescale128 B111
void analogPrescale(int divisionFactor);