fw-rust: Move PWM handling into screen module
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Move the handling of the PWM signal which generates the dimmable
backlight signal into the screen module.
This commit is contained in:
finga 2022-03-30 23:01:45 +02:00
parent fdd1f4636d
commit 134db298f6
2 changed files with 44 additions and 18 deletions

View file

@ -58,9 +58,6 @@ impl ClockGenerator {
let dp = Peripherals::take().unwrap();
let pins = pins!(dp);
// Set display PWM backlight pin as output
pins.pd5.into_output();
// Init SPI
let (spi, _) = Spi::new(
dp.SPI,
@ -79,7 +76,13 @@ impl ClockGenerator {
);
Self {
screen: Screen::new(dp.TC0, spi, pins.pb0.into_output(), pins.pb1.into_output()),
screen: Screen::new(
dp.TC0,
spi,
pins.pd5.into_output(),
pins.pb0.into_output(),
pins.pb1.into_output(),
),
tc1: dp.TC1,
exint: dp.EXINT,
delay: Delay::<MHz8>::new(),