nfig (RCC_HCLK_Div2); _PCLK1Config (RCC_HCLK_Div4);
# define PLL_M 8
# define PLL_N 336
# define PLL_P 2
# define PLL_Q 7_PLLConfig (RCC_PLLSource_HSE, PLL_M, PLL_N, PLL_P, PLL_Q); _PLLCmd ( ENABLE ); p>
while (RCC_GetFlagStatus (RCC_FLAG_PLLRDY) == RESET ) {} _SYSCLKConfig (RCC_SYSCLKSource_PLLCLK);
while (RCC_GetSYSCLKSource ()!=0x08) {}
Малюнок ПБ.1 - Текст програми (); } _GetClocksFreq (& SYSCLK_Frequency); _AHB1PeriphClockCmd (RCC_AHB1Periph_DMA1 | RCC_AHB1Periph_DMA2 | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC, ENABLE ); RCC_APB1PeriphClockCmd (RCC_APB1Periph_DAC|RCC_APB1Periph_TIM2|RCC_APB1Periph_TIM3|RCC_APB1Periph_TIM6|RCC_APB1Periph_USART3, ENABLE ); _APB2PeriphClockCmd (RCC_APB2Periph_ADC1, ENABLE ); }
void GPIO_Configuration ( void )
{gpio_struct. GPIO_Pin=GPIO_Pin_10; _struct. GPIO_Speed ??= GPIO_Speed_100MHz ; _struct. GPIO_OType= GPIO_OType_PP ; _struct. GPIO_PuPd= GPIO_PuPd_UP ; _struct. GPIO_Mode= GPIO_Mode_AF ; _Init (GPIOC, & gpio_struct); _PinAFConfig (GPIOC, GPIO_PinSource10, GPIO_AF_USART3); _struct. GPIO_Pin=GPIO_Pin_11; _struct. GPIO_Mode= GPIO_Mode_AF ; _Init (GPIOC, & gpio_struct); _PinAFConfig (GPIOC, GPIO_PinSource11, GPIO_AF_USART3); _struct. GPIO_Pin=GPIO_Pin_0; _struct. GPIO_Mode= GPIO_Mode_AN
gpio_struct. GPIO_PuPd= GPIO_PuPd_NOPULL ; _Init (GPIOA, & gpio_struct); _struct. GPIO_Pin=GPIO_Pin_1; _struct. GPIO_Mode= GPIO_Mode_AN
gpio_struct. GPIO_PuPd= GPIO_PuPd_NOPULL ; _Init (GPIOA, & gpio_struct); _struct. GPIO_Pin=GPIO_Pin_5; _struct. GPIO_Mode= GPIO_Mode_AN
gpio_struct. GPIO_PuPd= GPIO_PuPd_NOPULL ; _Init (GPIOA, & gpio_struct); }
void Timer_Snapshot_Configuration ( void )
{timer3_base. TIM_Period=48000-1; _base. TIM_Prescaler=100-1; _base. TIM_ClockDivision=0; _base. TIM_CounterMode=TIM_CounterMode_Up; _TimeBaseInit (TIM3, & timer3_base); _EnableIRQ ( TIM3_IRQn ); _ITConfig (TIM3, TIM_IT_Update, ENABLE ) ; _Cmd (TIM3, ENABLE ); }
void Timer_Adc_Configuration (uint32_t period)
{timer2_base. TIM_Prescaler=0; _base. TIM_Period=period - 1; _base. TIM_ClockDivision=0; _base. TIM_CounterMode=TIM_CounterMode_Up; _TimeBaseInit (TIM2, & timer2_base); }
void Timer_Dac_Configuration (uint32_t period)
{timer6_base. TIM_Prescaler=0; _base. TIM_Period=period - 1; _base. TIM_ClockDivision=0; _base. TIM_CounterMode=TIM_Cou...