Class daisy::AdcHandle¶
Handler for analog to digital conversion.
#include <adc.h>
Public Types¶
| Type | Name |
|---|---|
| enum | OverSampling |
Public Functions¶
| Type | Name |
|---|---|
| AdcHandle () |
|
| uint16_t | Get (uint8_t chn) const |
| float | GetFloat (uint8_t chn) const |
| uint16_t | GetMux (uint8_t chn, uint8_t idx) const |
| float | GetMuxFloat (uint8_t chn, uint8_t idx) const |
| uint16_t * | GetMuxPtr (uint8_t chn, uint8_t idx) const |
| uint16_t * | GetPtr (uint8_t chn) const |
| void | Init (AdcChannelConfig * cfg, size_t num_channels, OverSampling ovs=OVS_32) |
| void | Start () |
| void | Stop () |
| ~AdcHandle () |
Public Types Documentation¶
enum OverSampling¶
enum daisy::AdcHandle::OverSampling {
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 Get¶
Single channel getter
Parameters:
chnchannel to get
Returns:
Converted value
function GetFloat¶
Get floating point from single channel
Parameters:
chnChannel to get from
Returns:
Floating point converted value
function GetMux¶
Getters for multiplexed inputs on a single channel (up to 8 per ADC input).
Parameters:
chnChannel to get fromidx&
Returns:
data
function GetMuxFloat¶
Getters for multiplexed inputs on a single channel (up to 8 per ADC input).
Parameters:
chnChannel to get fromidx&
Returns:
Floating point data
function GetMuxPtr¶
Getters for multiplexed inputs on a single channel. (Max 8 per chan)
Parameters:
chnChannel to get fromidx&
Returns:
Pointer to data
function GetPtr¶
Get pointer to a value from a single channel
Parameters:
chn
Returns:
Pointer to converted value
function Init¶
void daisy::AdcHandle::Init (
AdcChannelConfig * cfg,
size_t num_channels,
OverSampling ovs=OVS_32
)
Initializes the ADC with the pins passed in.
Parameters:
*cfgan array of AdcChannelConfig of the desired channelnum_channelsnumber of ADC channels to initializeovsOversampling amount - Defaults to OVS_32
function Start¶
Starts reading from the ADC
function Stop¶
Stops reading from the ADC
function ~AdcHandle¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/per/adc.h