This example enables Master SPI 0 onto pins 16 to 21 using up to three slave
selects.
- Configure MIO pin 16 for clock output. Write
0x0000_22A0to the slcr.MIO_PIN_16 register.- Route SPI 0 clock to pin 16.
- Enable output, [TRI_ENABLE] = 0.
- LVCMOS18: [IO_TYPE] =
001 - Slow CMOS drive edge.
- Disable internal pull-up resistor.
- Disable HSTL receiver.
- Configure MIO pins 17 for MISO input. Write
0x0000_02A0to each of the slcr.MIO_PIN_17 register.- Route SPI 0 MISO to pin 17.
- Disable output. [TRI_ENABLE] = 1.
- LVCMOS18: [IO_TYPE] =
001. - Slow CMOS drive edge.
- Disable internal pull-up resistor.
- Disable HSTL receiver.
- Configure MIO pin 18, 19 and/or 20 for Slave Select outputs. Write
0x0000_32A0to the slcr.MIO_PIN_18, 19 and/or 20 registers. The internal pull-up is enabled.- Route SPI 0 slave selects signal(s) to pins 18, 19 and/or 20. Any and all of the slave selects can be activated for master mode. In slave mode, SS 0 must be used.
- 3-state controlled by SPI: [TRI_ENABLE] = 0.
- LVCMOS18: [IO_TYPE] =
001. - Slow CMOS drive edge.
- Enable internal pull-up resistor.
- Disable HSTL receiver.
- Configure MIO pins 21 for MOSI. Write
0x0000_22A0to each of the slcr.MIO_PIN_21 register:- Route SPI 0 MOSI to pin 21.
- 3-state controlled by SPI [TRI_ENABLE] = 0.
- LVCMOS18: [IO_TYPE] =
001. - Slow CMOS drive edge.
- Disable internal pull-up resistor.
- Disable HSTL receiver.