daisy::AdcHandle¶
Module: LIBDAISY / PERIPHERAL / ANALOG
Handler for analog to digital conversion.
#include <adc.h>
Public Types¶
Name | |
---|---|
enum | OverSampling |
Public Functions¶
Name | |
---|---|
AdcHandle() | |
~AdcHandle() | |
void | Init(AdcChannelConfig * cfg, size_t num_channels, OverSampling ovs =OVS_32) |
void | Start() |
void | Stop() |
uint16_t | Get(uint8_t chn) const |
uint16_t * | GetPtr(uint8_t chn) const |
float | GetFloat(uint8_t chn) const |
uint16_t | GetMux(uint8_t chn, uint8_t idx) const |
uint16_t * | GetMuxPtr(uint8_t chn, uint8_t idx) const |
float | GetMuxFloat(uint8_t chn, uint8_t idx) const |
Public Types Documentation¶
enum OverSampling¶
Enumerator | Value | Description |
---|---|---|
OVS_NONE | & | |
OVS_4 | & | |
OVS_8 | & | |
OVS_16 | & | |
OVS_32 | & | |
OVS_64 | & | |
OVS_128 | & | |
OVS_256 | & | |
OVS_512 | & | |
OVS_1024 | & | |
OVS_LAST | & |
Supported oversampling amounts
Public Functions Documentation¶
function AdcHandle¶
function ~AdcHandle¶
function Init¶
Parameters:
- ***cfg** an array of AdcChannelConfig of the desired channel
- num_channels number of ADC channels to initialize
- ovs Oversampling amount - Defaults to OVS_32
Initializes the ADC with the pins passed in.
function Start¶
Starts reading from the ADC
function Stop¶
Stops reading from the ADC
function Get¶
Parameters:
- chn channel to get
Return: Converted value
Single channel getter
function GetPtr¶
Parameters:
- chn
Return: Pointer to converted value
Get pointer to a value from a single channel
function GetFloat¶
Parameters:
- chn Channel to get from
Return: Floating point converted value
Get floating point from single channel
function GetMux¶
Parameters:
- chn Channel to get from
- idx &
Return: data
Getters for multiplexed inputs on a single channel (up to 8 per ADC input).
function GetMuxPtr¶
Parameters:
- chn Channel to get from
- idx &
Return: Pointer to data
Getters for multiplexed inputs on a single channel. (Max 8 per chan)
function GetMuxFloat¶
Parameters:
- chn Channel to get from
- idx &
Return: Floating point data
Getters for multiplexed inputs on a single channel (up to 8 per ADC input).
---¶
Updated on 2024-01-03 at 19:41:01 +0000