PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Initialize ADC124S021 and measure voltage as a raw, 12-bit5 adc value.
CONSTRUCTION ZONE: This library is preliminary, revisions pending.
More...
Go to the source code of this file.
Functions | |
int | adc124S021dc (int channel) |
void | adc_init (int csPin, int sclPin, int doPin, int diPin) |
Initialize A/D converter. More... | |
int | adc_in (int channel) |
Get value that corresponds to voltage measurement on one of the A/D converter's input channels. This number indicates voltage in terms of 4096ths of 5 v. More... | |
Variables | |
static int | dout |
static int | din |
static int | scl |
static int | cs |
Initialize ADC124S021 and measure voltage as a raw, 12-bit5 adc value.
CONSTRUCTION ZONE: This library is preliminary, revisions pending.
Definition in file adcDCpropab.c.
int adc_in | ( | int | channel | ) |
Get value that corresponds to voltage measurement on one of the A/D converter's input channels. This number indicates voltage in terms of 4096ths of 5 v.
channel | The A/D converter's input channel, either channel 0, 1, 2, or 3. Marked A/D 0, 1, 2 or 3 on the Propeller Activity Board. |
Definition at line 29 of file adcDCpropab.c.
void adc_init | ( | int | csPin, |
int | sclPin, | ||
int | doPin, | ||
int | diPin | ||
) |
Initialize A/D converter.
@detail Call this function once before calling adc_in or adc_volts.
Propeller Activity Board Example:
csPin,Propeller | I/O pin connected to the A/D converter's chip select pin. The Propeller chip uses that pin to enable communication with the A/D converter chip. This connection is labeled /CS-P21 on the Propeller Activity Board. In that case Propeller I/O pin P21 is connected to the A/D converter's chip select pin, so you would use 21 for this parameter. |
sclPin,Propeller | I/O pin connected to the A/D converter's serial clock pin. The Propeller chip sends a series of pulses to the A/D converter's SCL pin to drive the conversion and signal to send/recieve binary conversion values. This connection is labeled SCL-P20 on the Propeller Activity Board. In that case Propeller I/O pin P20 is connected to the A/D converter's serial clock pin, so you would use 20 for this parameter. |
doPin,Propeller | I/O pin connected to the A/D converter's data out pin. The A/D converter sends binary values to the controller with this pin. This connection is labeled DO-P19 on the Propeller Activity Board. In that case Propeller I/O pin P19 is connected to the A/D converter's data out pin, so you would use 19 for this parameter. |
diPin,Propeller | I/O pin connected to the A/D converter's data in pin. The Propeller chip sends a channel selection to the A/D converter, and it receives it with this pin. This connection is labeled DI-P18 on the Propeller Activity Board. In that case Propeller I/O pin P18 is connected to the A/D converter's chip data in, so you would use 18 for this parameter. |
Definition at line 21 of file adcDCpropab.c.