doc: avoid usage of rcc_peripheral_enable_clock

Use the simpler, safer rcc_periph_clock_enable instead
This commit is contained in:
Karl Palsson 2019-12-12 20:35:57 +00:00
parent 4a9ba30138
commit 557e7aa50f
3 changed files with 4 additions and 5 deletions

View File

@ -62,7 +62,7 @@ sent out.
@code @code
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO4); GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO4);
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_DACEN); rcc_periph_clock_enable(RCC_DAC);
dac_disable(CHANNEL_1); dac_disable(CHANNEL_1);
dac_set_waveform_characteristics(DAC_CR_MAMP1_8); dac_set_waveform_characteristics(DAC_CR_MAMP1_8);
dac_set_waveform_generation(DAC_CR_WAVE1_NOISE); dac_set_waveform_generation(DAC_CR_WAVE1_NOISE);

View File

@ -51,10 +51,9 @@ and ADC, reset ADC and set the prescaler divider. Set dual mode to independent
(default). Enable triggering for a software trigger. (default). Enable triggering for a software trigger.
@code @code
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_ADC1EN); rcc_periph_clock_enable(RCC_ADC1);
adc_power_off(ADC1); adc_power_off(ADC1);
rcc_peripheral_reset(&RCC_APB2RSTR, RCC_APB2RSTR_ADC1RST); rcc_periph_reset_pulse(RST_ADC1);
rcc_peripheral_clear_reset(&RCC_APB2RSTR, RCC_APB2RSTR_ADC1RST);
rcc_set_adcpre(RCC_CFGR_ADCPRE_PCLK2_DIV2); rcc_set_adcpre(RCC_CFGR_ADCPRE_PCLK2_DIV2);
adc_set_dual_mode(ADC_CR1_DUALMOD_IND); adc_set_dual_mode(ADC_CR1_DUALMOD_IND);
adc_disable_scan_mode(ADC1); adc_disable_scan_mode(ADC1);

View File

@ -46,7 +46,7 @@
* *
* @code * @code
* gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO1); * gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO1);
* rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_ADC1EN); * rcc_periph_clock_enable(RCC_ADC1);
* adc_set_clk_prescale(RCC_CFGR_ADCPRE_BY2); * adc_set_clk_prescale(RCC_CFGR_ADCPRE_BY2);
* adc_disable_scan_mode(ADC1); * adc_disable_scan_mode(ADC1);
* adc_set_single_conversion_mode(ADC1); * adc_set_single_conversion_mode(ADC1);