modm API documentation
|
#include <modm/driver/adc/ads868x.hpp>
Public Typedefs | |
typedef modm::Value< DeviceIDRegister_t, 4, 16 > | DeviceID_t |
typedef modm::Value< ResetPowerControlRegister_t, 8, 8 > | WriteKey_t |
typedef modm::Configuration< SDIControlRegister_t, SDIMode, 0b11, 0 > | SDIMode_t |
typedef modm::Configuration< SDOControlRegister_t, SDOMode, 0b11, 0 > | SDOMode_t |
typedef modm::Configuration< SDOControlRegister_t, SourceSyncClock, 0b1, 6 > | SourceSyncClock_t |
typedef modm::Configuration< SDOControlRegister_t, SDO1Config, 0b1, 8 > | SDO1Config_t |
typedef modm::Configuration< DataOutControlRegister_t, DataValue, 0b111, 0 > | DataValue_t |
typedef modm::Configuration< RangeSelectionRegister_t, RangeSel, 0b1111, 0 > | RangeSel_t |
Public Types | |
enum | Register : uint8_t { DEV_ID_REG = 0x00, RST_PWRCTRL_REG = 0x04, SDI_CTL_REG = 0x08, SDO_CTL_REG = 0x0C, DATAOUT_CTL_REG = 0x10, RANGE_CTL_REG = 0x14, ALARM_REG = 0x20, ALARM_H_TH_REG = 0x24, ALARM_L_TH_REG = 0x28 } |
enum | DeviceIDRegister : uint32_t { Addr0 = Bit16, Addr1 = Bit17, Addr2 = Bit18, Addr3 = Bit19 } |
Device ID register. | |
enum | ResetPowerControlRegister : uint32_t { WKey0 = Bit8, WKey1 = Bit9, WKey2 = Bit10, WKey3 = Bit11, WKey4 = Bit12, WKey5 = Bit13, WKey6 = Bit14, WKey7 = Bit15, VDDAlarmDisable = Bit5, InputAlarmDisable = Bit4, RSTn_ApplicationReset = Bit2, NapModeEnable = Bit1, PowerDownEnable = Bit0 } |
enum | SDIControlRegister : uint32_t { SDIMode0 = Bit0, SDIMode1 = Bit1 } |
enum | SDIMode : uint8_t { Std_Pol0_Phase0 = 0, Std_Pol0_Phase1 = 1, Std_Pol1_Phase0 = 2, Std_Pol1_Phase1 = 3 } |
enum | SDOControlRegister : uint32_t { SDOMode0 = Bit0, SDOMode1 = Bit1, SSyncClock = Bit6, SDO1Config0 = Bit8, SDO1Config1 = Bit9, GPOValue = Bit12 } |
enum | SDOMode : uint8_t { SameAsSDI0 = 0b00, SameAsSDI1 = 0b01, Invalid = 0b10, ADCMasterClk_SourcSync = 0b11 } |
enum | SourceSyncClock : uint8_t { External = 0, Internal = 1 } |
enum | SDO1Config : uint8_t { SDO1_Tristated = 0b00, SDO1_Alarm = 0b01, SDO1_GPO = 0b10, SDO1_2BitsSDO = 0b11 } |
enum | DataOutControlRegister : uint32_t { DataVal0 = Bit0, DataVal1 = Bit1, DataVal2 = Bit2, ParityEnable = Bit3, Inc_Range = Bit8, Inc_InActiveAlarm_High = Bit10, Inc_InActiveAlarm1_Low = Bit11, Inc_VDDActiveAlarm0_High = Bit12, Inc_VDDActiveAlarm1_Low = Bit13, Inc_DeviceAddr = Bit14 } |
enum | DataValue : uint8_t { ConversionData = 0b000, All0 = 0b100, All1 = 0b101, Seq01 = 0b110, Seq0011 = 0b111 } |
enum | RangeSelectionRegister : uint32_t { RangeSel0 = Bit0, RangeSel1 = Bit1, RangeSel2 = Bit2, RangeSel3 = Bit3, InternalRefDisabled = Bit6 } |
enum | RangeSel : uint8_t { Range_Bipolar_3_000_VRef = 0b0000, Range_Bipolar_2_500_VRef = 0b0001, Range_Bipolar_1_500_VRef = 0b0010, Range_Bipolar_1_250_VRef = 0b0011, Range_Bipolar_0_625_VRef = 0b0100, Range_Unipolar_3_00_VRef = 0b1000, Range_Unipolar_2_50_VRef = 0b1001, Range_Unipolar_1_50_VRef = 0b1010, Range_Unipolar_1_25_VRef = 0b1011 } |
Public Member Functions | |
MODM_FLAGS32 (DeviceIDRegister) | |
MODM_FLAGS32 (ResetPowerControlRegister) | |
MODM_FLAGS32 (SDIControlRegister) | |
MODM_FLAGS32 (SDOControlRegister) | |
MODM_FLAGS32 (DataOutControlRegister) | |
MODM_FLAGS32 (RangeSelectionRegister) | |
void | initialize () |
Call this function once before using the device. | |
uint16_t | singleConversion () |
void | setDeviceAddress (uint8_t devID) |
uint8_t | getDeviceAddress () |
void | setOutputProtocol (SDOMode mode, SourceSyncClock syncClock, SDO1Config sdo1Config) |
void | setRange (RangeSel range) |
RangeSel | getRange () |
void | attachConfigurationHandler (Spi::ConfigurationHandler handler) |
Protected Member Functions | |
bool | acquireMaster () |
bool | releaseMaster () |