Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ getData KEYWORD2
currentChannel KEYWORD2
internalCalibration KEYWORD2
toVoltage KEYWORD2

setPWRSW KEYWORD2
#######################################
# Instances (KEYWORD2)
#######################################
Expand Down
16 changes: 16 additions & 0 deletions src/ad7124.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ Ad7124Chip::setCurrentSource (uint8_t source, uint8_t ch, IoutCurrent current) {
return writeRegister (IOCon_1);
}

// -----------------------------------------------------------------------------
int
Ad7124Chip::setPWRSW(bool enabled) {
Ad7124Register * r;

r = &reg[IOCon_1];

r->value &= ~ AD7124_IO_CTRL1_REG_PDSW;

if (enabled == true) {
r->value |= AD7124_IO_CTRL1_REG_PDSW;
}

return writeRegister (IOCon_1);
}

// -----------------------------------------------------------------------------
int
Ad7124Chip::setBiasPins (uint16_t pinMask) {
Expand Down
11 changes: 11 additions & 0 deletions src/ad7124.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ class Ad7124Chip {
*/
int setCurrentSource (uint8_t source, uint8_t ch, Ad7124::IoutCurrent current);

/**
* @brief Set state of power switch pin
*
* The AD7124-4 contains a low side switch that can be used
* to control excitation power to a bridge circuit.
*
* @param enabled State to set switch to. enabled = closed
* @return 0 for success or negative error code
*/
int setPWRSW(bool enabled) ;

/**
* @brief Setting up bias voltage on AIN-Pins
*
Expand Down