Shield Code 6.0
|
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. | |
Manages interfacing with Max1148 ADC.
Definition at line 57 of file Max1148.hpp.
|
inline |
ADC constructor. Sets cs_pin as per ADC_CS_PIN macro. Chooses channel from Channel enum.
channel | The 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.
|
private |
Reads a single ADC value from the Max1148 ADC. Used in adc_read_avg.
Definition at line 16 of file Max1148.cpp.
|
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.
avg_num | The number of samples to average. |
avg_num | The number of samples to average. |
Definition at line 3 of file Max1148.cpp.
|
private |
Sets the chip select pin to high.
Sets the chip select pin to high.
Definition at line 43 of file Max1148.cpp.
|
private |
Sets the chip select pin to low.
Sets the chip select pin to low.
Definition at line 38 of file Max1148.cpp.
|
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.
|
private |
Channel for the ADC. Selected in the constructor.
Definition at line 70 of file Max1148.hpp.
|
private |
Chip select pin for the ADC.
Definition at line 66 of file Max1148.hpp.