You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/**
|
|
|
|
* @file adc.hpp
|
|
|
|
* @brief Manages signal reading through the ADC.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Clyne Sullivan
|
|
|
|
*
|
|
|
|
* Distributed under the GNU GPL v3 or later. You should have received a copy of
|
|
|
|
* the GNU General Public License along with this program.
|
|
|
|
* If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef STMDSP_ADC_HPP_
|
|
|
|
#define STMDSP_ADC_HPP_
|
|
|
|
|
|
|
|
#include "hal.h"
|
|
|
|
|
|
|
|
enum class ADCRate {
|
|
|
|
R2P5,
|
|
|
|
R6P5,
|
|
|
|
R12P5,
|
|
|
|
R24P5,
|
|
|
|
R47P5,
|
|
|
|
R92P5,
|
|
|
|
R247P5,
|
|
|
|
R640P5
|
|
|
|
};
|
|
|
|
|
|
|
|
void adc_init();
|
|
|
|
adcsample_t *adc_read(adcsample_t *buffer, size_t count);
|
|
|
|
void adc_set_rate(ADCRate rate);
|
|
|
|
|
|
|
|
#endif // STMDSP_ADC_HPP_
|
|
|
|
|