void xpcc::MAX6966<Spi, Cs, DRIVERS>::setHalfCurrent(uint16_t channel, bool full) { if (channel >= DRIVERS*10) return; uint8_t driver = channel / 10; uint8_t driverChannel = channel % 10; uint8_t mask; max6966::Register reg; if (driverChannel <= 7) { mask = (1 << driverChannel); reg = max6966::REGISTER_CURRENT7_0; } else { mask = (1 << (driverChannel - 8)); reg = max6966::REGISTER_CURRENT9_8; } uint8_t bit = full ? mask : 0; writeToDriverMasked(driver, reg, bit, mask); }
/// configure the hold time static inline void setHoldTime(max6966::Time time=max6966::TIME_1s, uint8_t driver=0) { writeToDriverMasked(driver, max6966::REGISTER_RAMP_UP, (time << 3), (0x07 << 3)); }
/// configure the ramp up time static inline void setRampUpTime(max6966::Time time=max6966::TIME_1s, uint8_t driver=0) { writeToDriverMasked(driver, max6966::REGISTER_RAMP_UP, time, 0x07); }