ADS1231 General Purpose library to deal with ADS1231 AD Converter
ADS1231_GP Class Reference
ADS1231_GP Class. More...
#include <ADS1231_GP.h>
Public Member Functions | |
| ADS1231_GP (PinName doutPin, PinName clkPin, PinName pdwnPin) | |
| Creates an instance. | |
| void | setPower (unsigned int p) |
| Sets power ON or OFF to ADS1231. | |
| unsigned int | dataAvailable (void) |
| Checks if data is available to be read. | |
| unsigned int | readValue (void) |
| Reads a value from ADS1231 output. | |
Detailed Description
ADS1231_GP Class.
Definition at line 21 of file ADS1231_GP.h.
Constructor & Destructor Documentation
| ADS1231_GP | ( | PinName | doutPin, |
| PinName | clkPin, | ||
| PinName | pdwnPin | ||
| ) |
Creates an instance.
This version does not support speed changes (speed must be hard-wired or controlled externally).
- Parameters:
-
doutPin Pin connected to data out (!DRDY/DOUT) from ADS1231 clkPin Pin connected to serial clock (SCLK) to ADS1231 pdwnPin Pin connected to power down (!PDWN) to ADS1231
Definition at line 11 of file ADS1231_GP.cpp.
Member Function Documentation
| unsigned int dataAvailable | ( | void | ) |
Checks if data is available to be read.
- Returns:
- 1 if ADS1231 is ON and data is available, 0 otherwise.
Definition at line 19 of file ADS1231_GP.cpp.
| unsigned int readValue | ( | void | ) |
Reads a value from ADS1231 output.
You must first ensure there is data available using dataAvailable().
- Returns:
- Raw data read as unsigned int
Definition at line 25 of file ADS1231_GP.cpp.
| void setPower | ( | unsigned int | p ) |
Sets power ON or OFF to ADS1231.
- Parameters:
-
p Boolean indicating power down. 1=OFF, 0=ON
Definition at line 15 of file ADS1231_GP.cpp.
Generated on Tue Jul 19 2022 12:52:53 by
1.7.2