#include <otADS868x.h>
Public Types | |
enum | InputRange { BIP_12V, BIP_10V, BIP_6V, BIP_5V, BIP_2_5V, UNI_12V = 8, UNI_10V, UNI_6V, UNI_5V } |
enum | RegisterAddress { DEVICE_ID_REG = 0x00, RST_PWRCTL_REG = 0x04, SDI_CTL_REG = 0x08, SDO_CTL_REG = 0x0C, DATAOUT_CTL_REG = 0x10, RANGE_SEL_REG = 0x14, ALARM_REG = 0x20, ALARM_H_TH_REG = 0x24, ALARM_L_TH_REG = 0x28 } |
enum | Commands { C_NOP = 0x0000, CLEAR_HWORD = 0xC000, READ_HWORD = 0xC800, READ = 0x4800, WRITE_1 = 0xD000, WRITE_2 = 0xD200, WRITE_3 = 0xD400, SET_HWORD = 0xD800 } |
Public Member Functions | |
otADS868x () | |
void | init () |
void | setRange (InputRange rng) |
S16 | read () |
S16 | read (U32 num) |
void | read (S16 *buff, U32 len) |
void | read (S16 *buff, U32 len, U32 dly) |
void | read (S16 *buff, U32 len, U32 dly, U8 timer) |
void | read (F64 *buff, U32 len, U32 dly, U8 timer) |
void | add (F64 *buff, U32 len, U32 dly, U8 timer) |
U32 | evaluateDelay (F32 intervalDelay) |
float | volt (U16 avg=1) |
float | toVolt (S16 adu) |
bool | isBipolar () |
float | maxVoltage () |
float | minVoltage () |
float | lsb () |
S32 | toUnipolar (S16 adu) |
S16 | toADU (F32 volt) |
bool | trigger (F32 volt, U32 timeout) |
|
|
|
|
|
|
Create the class |
|
Read a stream of raw data from ADC with current settings and add to storage buffer.
|
|
Calculate a constant to have a desired interval time
|
|
Init SPI related channel and initial settings |
|
Check if the setted range is bipolar.
|
|
Bit weight as volt
|
|
Check maximum allowed input voltage
|
|
Check minimum allowed input voltage
|
|
Read a stream of raw data from ADC with current settings.
|
|
Read a stream of raw data from ADC with current settings.
|
|
Read a stream of raw data from ADC with current settings. Total Delay for data stored in SDRAM us = len * (1.49001 + dly / 11.11110232) Value for requested interval delay dly = (us - 1.49001) * 11.11110232
|
|
Read a stream of raw data from ADC with current settings. Read is at the maximum speed.
|
|
Read an averaged raw data from ADC with current settings
|
|
Read a raw data from ADC with current settings
|
|
Specify the ADC range
|
|
Convert from volt to ADU
|
|
From two's complement to unsigned
|
|
Convert from ADU to Volt.
|
|
Reads continuously and returns if the read value is greater than the set value or the timeout is reached.
|
|
Read a sample from ADC and return its value as Volt
|