30 #include "mcu_periph/pwm_input_arch.h"
39 #define PWM_INPUT1_PINSEL PINSEL1
40 #define PWM_INPUT1_PINSEL_BIT 26
41 #define PWM_INPUT1_PINSEL_VAL (0x2 << PWM_INPUT1_PINSEL_BIT)
42 #define PWM_INPUT1_PINSEL_MASK (0x3 <<PWM_INPUT1_PINSEL_BIT)
46 #define PWM_INPUT2_PINSEL PINSEL1
47 #define PWM_INPUT2_PINSEL_BIT 28
48 #define PWM_INPUT2_PINSEL_VAL (0x3 << PWM_INPUT2_PINSEL_BIT)
49 #define PWM_INPUT2_PINSEL_MASK (0x3 <<PWM_INPUT2_PINSEL_BIT)
63 PWM_INPUT1_PINSEL = (PWM_INPUT1_PINSEL & ~PWM_INPUT1_PINSEL_MASK) | PWM_INPUT1_PINSEL_VAL;
68 PWM_INPUT2_PINSEL = (PWM_INPUT2_PINSEL & ~PWM_INPUT2_PINSEL_MASK) | PWM_INPUT2_PINSEL_VAL;
76 void pwm_input_isr1(
void)
80 #if USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_HIGH
82 #elif USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_LOW
90 #if USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_HIGH
93 #elif USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_LOW
101 T0CCR &= ~TCCR_CR3_R;
102 #if USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_LOW
105 #elif USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_HIGH
112 #endif //USE_PWM_INPUT1
114 #ifdef USE_PWM_INPUT2
115 void pwm_input_isr2(
void)
119 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
121 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
128 T0CCR &= ~TCCR_CR0_F;
129 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
132 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
140 T0CCR &= ~TCCR_CR0_R;
141 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
144 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
151 #endif //USE_PWM_INPUT2