Only applied to STM32 doc trees at present. Instead of declaring a group for "STM32blah" in the doc-blah.h files, and then trying to put all the common+specific peripheral code into those groups, (which is what led to the stub doxygen holder empty .c files) Just use a standard name like "Peripheral APIS" and place everything into that. Demonstrated by converting ADC and USART peripherals, which is definitely not complete, but it shows how to make things less magical, and less prone to copy/paste errors. Now, you can copy/paste and it will do the right thing, because everyone uses the same group names. This is also how to unify the mix of "STM32blah->Periphblah" and _also_ the dangling "periph_file" modules in doxygen, it merges them together properly, as they're intended to be really.
57 lines
1.6 KiB
C
57 lines
1.6 KiB
C
/** @addtogroup adc_file ADC peripheral API
|
|
@ingroup peripheral_apis
|
|
|
|
@author @htmlonly © @endhtmlonly 2016 Karl Palsson <karlp@tweak.net.au>
|
|
|
|
|
|
LGPL License Terms @ref lgpl_license
|
|
*/
|
|
/*
|
|
* This file is part of the libopencm3 project.
|
|
*
|
|
* Copyright (C) 2016 Karl Palsson <karlp@tweak.net.au>
|
|
*
|
|
* This library is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <libopencm3/stm32/adc.h>
|
|
|
|
/**@{*/
|
|
|
|
/**
|
|
* Enable the ADC Voltage regulator
|
|
* Before any use of the ADC, the ADC Voltage regulator must be enabled.
|
|
* You must wait up to 10uSecs afterwards before trying anything else.
|
|
* @param[in] adc ADC block register address base
|
|
* @sa adc_disable_regulator
|
|
*/
|
|
void adc_enable_regulator(uint32_t adc)
|
|
{
|
|
ADC_CR(adc) |= ADC_CR_ADVREGEN;
|
|
}
|
|
|
|
/**
|
|
* Disable the ADC Voltage regulator
|
|
* You can disable the adc vreg when not in use to save power
|
|
* @param[in] adc ADC block register address base
|
|
* @sa adc_enable_regulator
|
|
*/
|
|
void adc_disable_regulator(uint32_t adc)
|
|
{
|
|
ADC_CR(adc) &= ~ADC_CR_ADVREGEN;
|
|
}
|
|
|
|
/**@}*/
|
|
|