File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,18 @@ The code below shows how to use the pinmux driver to do this:
4242
4343...
4444
45- auto pinmux = SonataPinmux();
46- pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_1, 2 );
47- pinmux.block_input_select(SonataPinmux::BlockInput::spi_1_cipo, 3 );
48- pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_2, 2 );
49- pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_4, 2 );
45+ auto pinSinks = SonataPinmux::PinSinks();
46+ auto blockSinks = SonataPinmux::BlockSinks();
47+
48+ pinSinks->get (SonataPinmux::PinSink::pmod0_1).select(2); // cs_0
49+ blockSinks->get(SonataPinmux::BlockInput::spi_1_cipo).select(3); // cipo
50+ pinSinks->get(SonataPinmux::OutputPin::pmod0_2).select(2); // coi
51+ pinSinks->get(SonataPinmux::OutputPin::pmod0_4).select(2); // sclk
52+ pinSinks->get(SonataPinmux::OutputPin::pmod0_9).select(2); // cs_1
53+ pinSinks->get(SonataPinmux::OutputPin::pmod0_10).select(2); // cs_2
5054```
5155
52- Following this you can then use the ` spi1 ` SPI instance to communicate with whatever SPI device is plugged into PMOD0.
56+ Following this you can then use the `spi_1 ` SPI instance to communicate with whatever SPI device is plugged into PMOD0.
5357
5458## Driver Usage
5559
You can’t perform that action at this time.
0 commit comments