io_plan.h
Generated from the header
This page is rodeo-sdk/common/io_plan.h — its comments and declarations.
To change it, change the header.
An app says what each of the ten connectors is for; PlanIo() checks it against what the hardware can do (analog only where there is an ADC channel, CV out only on the two DAC pins) and works out the order the ADC scans in. A wrong configuration fails here, by silkscreen name, instead of as a pin that reads nothing. Pure logic: host-tested in common/tests/io_plan_gtest.cpp, used by io.h on the Seed.
IoMode
enum class IoMode : uint8_tkUnusedkDigitalInkDigitalInPullUpkDigitalInPullDownkDigitalOutkAnalogIn— through the Seed’s ADC: A1-A7, CV1, CV2kCvOut— the Seed’s DAC, 0-3.3 V: CV1, CV2
IoConfig
struct IoConfigWhat each connector is for, indexed by board::Io.
Members
IoMode mode[board::kNumIo] = {}
IoConfig::Set
IoConfig& Set(board::Io c, IoMode m);IoPlan
struct IoPlanA checked configuration, ready for the hardware.
Members
bool okint8_t bad— the connector that failed (board::Io), or -1const char* why— what’s wrong with ituint8_t n_adc— analog inputs, in scan orderuint8_t adc_conn[board::kNumIo]— connector for each scan positionint8_t adc_index[board::kNumIo]— scan position for each connector, or -1bool dac1— DAC channels in usebool dac1, dac2— DAC channels in use
PlanIo
inline IoPlan PlanIo(const IoConfig& cfg);DacCode
inline uint16_t DacCode(float v);0..1 to the DAC’s 12-bit code, clamped and rounded.