add unified compile target
[avr_work.git] / common / servo_conf.h
blob38fb3f78b8d06927c24e30314619b00cd7c1652b
2 //FIXME: Currently the following line does nothing, had to place the '5' directly in the S_# macros
3 #define S_TIMER 5
5 #define S_A(_A) COMB2(_A, 5 )
6 #define S_I(_A,_B) COMB3(_A, 5 ,_B)
8 #define COMB3(_A,_num,_C) _A ## _num ## _C
9 #define COMB2(_A,_num) _A ## _num
13 // Registers
14 // Bits
15 #define SERVO_TCCRB S_I(TCCR,B)
16 #define WGM3 S_I(WGM,3)
17 #define WGM2 S_I(WGM,2)
19 #define SERVO_TCCRA S_I(TCCR,A)
20 #define WGM1 S_I(WGM,1)
21 #define WGM0 S_I(WGM,0)
22 #define CS2 S_I(CS,2)
23 #define CS1 S_I(CS,1)
24 #define CS0 S_I(CS,0)
26 #define SERVO_TIMSK S_A(TIMSK)
27 #define OCIEA S_I(OCIE,A)
28 #define OCIEB S_I(OCIE,B)
29 #define OCIEC S_I(OCIE,C)
30 #define TOIE S_A(TOIE)
32 #define SERVO_ICR S_A(ICR)
33 #define SERVO_TCNT S_A(TCNT)
35 #define SERVO_OCRA S_I(OCR,A)
36 #define SERVO_OCRB S_I(OCR,B)
37 #define SERVO_OCRC S_I(OCR,C)
39 // Interrupts
40 #define TIMER_S_OVF_vect S_I(TIMER,_OVF_vect)
42 #define TIMER_S_COMPA_vect S_I(TIMER,_COMPA_vect)
43 #define TIMER_S_COMPB_vect S_I(TIMER,_COMPB_vect)
44 #define TIMER_S_COMPC_vect S_I(TIMER,_COMPC_vect)
46 // Power macro
47 #define power_timer_S_enable S_I(power_timer,_enable)