Shield Code 6.0
Loading...
Searching...
No Matches
Max1148 Class Reference

Manages interfacing with Max1148 ADC. More...

#include <Max1148.hpp>

Public Member Functions

 Max1148 (Channel channel)
 ADC constructor. Sets cs_pin as per ADC_CS_PIN macro. Chooses channel from Channel enum.
 

Private Member Functions

void csl ()
 Sets the chip select pin to low.
 
void csh ()
 Sets the chip select pin to high.
 
uint16_t adc_read_avg (int avg_number)
 Reads an average ADC value from the Max1148 ADC. Uses Arduino's SPI library. We don't use this anymore because we wanted to interleave ADC sampling between channels.
 
uint16_t adc_read ()
 Reads a single ADC value from the Max1148 ADC. Used in adc_read_avg.
 

Private Attributes

int cs_pin
 Chip select pin for the ADC.
 
uint8_t channel
 Channel for the ADC. Selected in the constructor.
 

Friends

class Pip
 ADC functions should really only be used in relation to Pip measurements, so everything is private and Pip is a friend.
 

Detailed Description

Manages interfacing with Max1148 ADC.

Definition at line 57 of file Max1148.hpp.

Constructor & Destructor Documentation

◆ Max1148()

Max1148::Max1148 ( Channel  channel)
inline

ADC constructor. Sets cs_pin as per ADC_CS_PIN macro. Chooses channel from Channel enum.

Parameters
channelThe channel to read from. Format: CHAN0, CHAN1, etc. I don't remember why it has to be static_cast but it works.

Definition at line 94 of file Max1148.hpp.

Member Function Documentation

◆ adc_read()

uint16_t Max1148::adc_read ( )
private

Reads a single ADC value from the Max1148 ADC. Used in adc_read_avg.

Definition at line 16 of file Max1148.cpp.

◆ adc_read_avg()

uint16_t Max1148::adc_read_avg ( int  avg_num)
private

Reads an average ADC value from the Max1148 ADC. Uses Arduino's SPI library. We don't use this anymore because we wanted to interleave ADC sampling between channels.

Reads an average ADC value from the Max1148 ADC. Uses Arduino's SPI library. We don't use this anymore because we wanted to interleave ADC sampling between channels.

Parameters
avg_numThe number of samples to average.
Parameters
avg_numThe number of samples to average.

Definition at line 3 of file Max1148.cpp.

◆ csh()

void Max1148::csh ( )
private

Sets the chip select pin to high.

Sets the chip select pin to high.

Definition at line 43 of file Max1148.cpp.

◆ csl()

void Max1148::csl ( )
private

Sets the chip select pin to low.

Sets the chip select pin to low.

Definition at line 38 of file Max1148.cpp.

Friends And Related Function Documentation

◆ Pip

friend class Pip
friend

ADC functions should really only be used in relation to Pip measurements, so everything is private and Pip is a friend.

Definition at line 61 of file Max1148.hpp.

Member Data Documentation

◆ channel

uint8_t Max1148::channel
private

Channel for the ADC. Selected in the constructor.

Definition at line 70 of file Max1148.hpp.

◆ cs_pin

int Max1148::cs_pin
private

Chip select pin for the ADC.

Definition at line 66 of file Max1148.hpp.


The documentation for this class was generated from the following files: