Beispiel #1
0
extern bool SetPinFrequency( int8_t pin, uint32_t frequency )
{
	uint8_t timer = digitalPinToTimer(pin);
	
	if(timer == TIMER0B)
		return Timer0_SetFrequency(frequency);
	else if(timer == TIMER1A || timer == TIMER1B)
		return Timer1_SetFrequency(frequency);
	else if(timer == TIMER2B)
		return Timer2_SetFrequency(frequency);
	else
		return false;
}
Beispiel #2
0
bool SetPinFrequency(int8_t pin, uint32_t frequency)
{
	uint8_t timer = digitalPinToTimer(pin);
	
	if(timer == TIMER0B)
	return Timer0_SetFrequency(frequency);
	else if(timer == TIMER1A || timer == TIMER1B)
	return Timer1_SetFrequency(frequency);
	else if(timer == TIMER2B)
	return Timer2_SetFrequency(frequency);
	else if(timer == TIMER3A || timer == TIMER3B || timer == TIMER3C)
	return Timer3_SetFrequency(frequency);
	else if(timer == TIMER4A || timer == TIMER4B || timer == TIMER4C)
	return Timer4_SetFrequency(frequency);
	else if(timer == TIMER5A || timer == TIMER5B || timer == TIMER5C)
	return Timer5_SetFrequency(frequency);
	else
	return false;
}