summaryrefslogtreecommitdiffstats
path: root/usb/src/dotstar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usb/src/dotstar.rs')
-rw-r--r--usb/src/dotstar.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/usb/src/dotstar.rs b/usb/src/dotstar.rs
index c7eed7d..13ccb8d 100644
--- a/usb/src/dotstar.rs
+++ b/usb/src/dotstar.rs
@@ -8,6 +8,14 @@ use trinket_m0::{
use apa102_spi::Apa102;
+type TrinketDotStar = Apa102<
+ SPIMaster1<
+ sercom::Sercom1Pad3<gpio::Pa31<gpio::PfD>>,
+ sercom::Sercom1Pad0<gpio::Pa0<gpio::PfD>>,
+ sercom::Sercom1Pad1<gpio::Pa1<gpio::PfD>>,
+ >,
+>;
+
pub fn new(
sercom: SERCOM1,
miso: gpio::Pa31<Input<Floating>>,
@@ -16,13 +24,7 @@ pub fn new(
port: &mut gpio::Port,
pm: &mut PM,
clocks: &mut GenericClockController,
-) -> Apa102<
- SPIMaster1<
- sercom::Sercom1Pad3<gpio::Pa31<gpio::PfD>>,
- sercom::Sercom1Pad0<gpio::Pa0<gpio::PfD>>,
- sercom::Sercom1Pad1<gpio::Pa1<gpio::PfD>>,
- >,
-> {
+) -> TrinketDotStar {
let gclk = clocks.gclk0();
let miso = miso.into_pad(port);
let mosi = mosi.into_pad(port);