Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize tim1_complementary_outputs example #470

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ void t1pwm_init( void )
AFIO->PCFR1 |= AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP1;

// PC3 is T1CH1_N, 10MHz Output alt func, push-pull
GPIOC->CFGLR &= ~( 0xf << ( 4 * 3 ) );
GPIOC->CFGLR |= ( GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF ) << ( 4 * 3 );
funPinMode( PC3, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF );

// PC6 is T1CH1, 10MHz Output alt func, push-pull
GPIOC->CFGLR &= ~( 0xf << ( 4 * 6 ) );
GPIOC->CFGLR |= ( GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF ) << ( 4 * 6 );
funPinMode( PC6, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF );

// Reset TIM1 to init all regs
RCC->APB2PRSTR |= RCC_APB2Periph_TIM1;
Expand Down
Loading