libDaisy
Public Types | Public Member Functions | Public Attributes | List of all members
daisy::AdcChannelConfig Struct Reference

#include <adc.h>

Public Types

enum  MuxPin { MUX_SEL_0 , MUX_SEL_1 , MUX_SEL_2 , MUX_SEL_LAST }
 

Public Member Functions

void InitSingle (dsy_gpio_pin pin)
 
void InitMux (dsy_gpio_pin adc_pin, size_t mux_channels, dsy_gpio_pin mux_0, dsy_gpio_pin mux_1={DSY_GPIOX, 0}, dsy_gpio_pin mux_2={DSY_GPIOX, 0})
 

Public Attributes

dsy_gpio pin_
 
dsy_gpio mux_pin_ [MUX_SEL_LAST]
 
uint8_t mux_channels_
 

Detailed Description

Configuration Structure for a given channel

Member Enumeration Documentation

◆ MuxPin

Which pin to use for multiplexing

Enumerator
MUX_SEL_0 

&

MUX_SEL_1 

&

MUX_SEL_2 

&

MUX_SEL_LAST 

&

Member Function Documentation

◆ InitMux()

void daisy::AdcChannelConfig::InitMux ( dsy_gpio_pin  adc_pin,
size_t  mux_channels,
dsy_gpio_pin  mux_0,
dsy_gpio_pin  mux_1 = {DSY_GPIOX, 0},
dsy_gpio_pin  mux_2 = {DSY_GPIOX, 0} 
)

Initializes a single ADC pin as a Multiplexed ADC. Requires a CD405X Multiplexer connected to the pin. You only need to supply the mux pins that are required, e.g. a 4052 mux would only require mux_0 and mux_1. Internal Callbacks handle the pin addressing.

Parameters
mux_channelsmust be 1-8
mux_0First mux pin
mux_1Second mux pin
mux_2Third mux pin
adc_pin&

◆ InitSingle()

void daisy::AdcChannelConfig::InitSingle ( dsy_gpio_pin  pin)

Initializes a single ADC pin as an ADC.

Parameters
pinPin to init.

Member Data Documentation

◆ mux_channels_

uint8_t daisy::AdcChannelConfig::mux_channels_

&

◆ mux_pin_

dsy_gpio daisy::AdcChannelConfig::mux_pin_[MUX_SEL_LAST]

&

◆ pin_

dsy_gpio daisy::AdcChannelConfig::pin_

&


The documentation for this struct was generated from the following file: