Ejemplo n.º 1
0
void
xpcc::MAX6966<Spi, Cs, DRIVERS>::setChannel(uint16_t channel, uint8_t value)
{
	if (channel >= DRIVERS*10)
		return;
	
	uint8_t driver = channel / 10;
	uint8_t reg = channel % 10;
	
	writeToDriver(driver, static_cast<max6966::Register>(reg), value);
}
Ejemplo n.º 2
0
		static inline void
		writeToDriverMasked(uint8_t driver, max6966::Register reg, uint8_t data, uint8_t mask)
		{
			uint8_t readout = readFromDriver(driver, reg);
			writeToDriver(driver, reg, (data & mask) | (readout & ~mask));
		}
Ejemplo n.º 3
0
		/// set peak current of one driver
		static inline void
		setCurrent(max6966::Current current, uint8_t driver=0)
		{
			writeToDriver(driver, max6966::REGISTER_GLOBAL_CURRENT, current);
		}
Ejemplo n.º 4
0
		/// configure the ramp down time
		static inline void
		setRampDownTime(max6966::Time time=max6966::TIME_1s, uint8_t driver=0)
		{
			writeToDriver(driver, max6966::REGISTER_RAMP_DOWN, time);
		}
Ejemplo n.º 5
0
		/// configure the Chip
		static inline void
		setConfiguration(uint8_t config, uint8_t driver=0)
		{
			writeToDriver(driver, max6966::REGISTER_CONFIGURATION, config);
		}