You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					8 lines
				
				212 B
			
		
		
			
		
	
	
					8 lines
				
				212 B
			| 
								 
											6 years ago
										 
									 | 
							
								void timer_init(TIM_TypeDef *TIM, int psc) {
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								  register_set(&(TIM->PSC), (psc-1), 0xFFFFU);
							 | 
						||
| 
								 | 
							
								  register_set(&(TIM->DIER), TIM_DIER_UIE, 0x5F5FU);
							 | 
						||
| 
								 | 
							
								  register_set(&(TIM->CR1), TIM_CR1_CEN, 0x3FU);
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								  TIM->SR = 0;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 |