-
-
Save metajack/5a0a427cc63053f66972e7f5034980e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let i2c = dp.I2C1.i2c((scl, sda), 1.mhz(), ccdr.peripheral.I2C1, &ccdr.clocks); | |
let mut pwm = Pca9685::new(i2c, 0x40).unwrap(); | |
pwm.enable().unwrap(); | |
pwm.set_output_driver(pwm_pca9685::OutputDriver::TotemPole).unwrap(); | |
pwm.set_output_logic_state(pwm_pca9685::OutputLogicState::Inverted).unwrap(); | |
pwm.set_disabled_output_value(pwm_pca9685::DisabledOutputValue::HighImpedance).unwrap(); | |
// dma the led states | |
let mut i2c = pwm.destroy(); | |
i2c.tx_dma(true); | |
let streams = StreamsTuple::new(dp.DMA1, ccdr.peripheral.DMA1); | |
let config = DmaConfig::default(); | |
let transfer: Transfer<_, _, MemoryToPeripheral, _, _> = Transfer::init( | |
streams.6, | |
i2c, | |
unsafe { &LED_BUFFER }, | |
None, | |
config, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment