|
|
|
@ -27,7 +27,7 @@
|
|
|
|
|
#include "digipot.h"
|
|
|
|
|
|
|
|
|
|
#include <Stream.h>
|
|
|
|
|
#include <SlowSoftI2CMaster.h> // https://github.com/stawel/SlowSoftI2CMaster
|
|
|
|
|
#include <SlowSoftI2CMaster.h> // https://github.com/felias-fogg/SlowSoftI2CMaster
|
|
|
|
|
|
|
|
|
|
// Settings for the I2C based DIGIPOT (MCP4018) based on WT150
|
|
|
|
|
|
|
|
|
@ -46,21 +46,21 @@ static byte current_to_wiper(const float current) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = {
|
|
|
|
|
SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL)
|
|
|
|
|
SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 1
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 2
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 3
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 4
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 5
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 6
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#if DIGIPOT_I2C_NUM_CHANNELS > 7
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL)
|
|
|
|
|
, SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS))
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|