/* Selects the output mode. Only used in counter mode. When done counting, the pin can be set to no output, to invert the current pin level, to set the pin high, or to set the pin low.  */
void timer_output_mode(uint32_t timer, enum timer_output_modes mode)
/* Selects the output mode. Only used in counter mode. When done counting, the pin can be set to no output, to invert the current pin level, to set the pin high, or to set the pin low.  */
void timer_output_mode(uint32_t timer, enum timer_output_modes mode)
{
	uint32_t reg = TIMER_CTRL(timer) & ~(TIMER_CTRL_WMOD_MASK << TIMER_CTRL_WMOD_SHIFT);
	TIMER_CTRL(timer) = reg | (mode << TIMER_CTRL_WMOD_SHIFT);
}