pxt-calliope/docs/reference/pins/spi-pins.md
Amerlander 918af4f3ac
Bump V3.0.22 (#110)
* change simulator svg

* change radio image

* Remove google fonts cdn

* change color of 'advanced' button

* font fix

* font fix 2

* display fix

* change fullsceen simulator bg

* Continuous servo

* handle continuous state

* adding shims

* update rendering for continuous servos

* fixing sim

* fix sig

* typo

* fix sim

* bump pxt

* bump pxt

* rerun travis

* Input blocks revision

- add Button and Pin event types
- merge onPinPressed & onPinReleased in new onPinEvent function
- create new onButtonEvent function

* update input blocks in docs and tests

* remove device_pin_release block

* Hide DAL.x behind Enum

* bring back deprecated blocks, but hide them

* shims and locales files

* fix input.input. typing

* remove buildpr

* bump V3

* update simulator aspect ratio

* add Loudness Block

* revoke loudness block

* Adds soundLevel

To be replaced by pxt-common-packages when DAL is updated.

* Remove P0 & P3 from AnalogPin

Co-authored-by: Juri <gitkraken@juriwolf.de>
2020-09-08 02:04:25 -07:00

44 lines
1.3 KiB
Markdown

# spi Pins
Set the Serial Peripheral Interface (SPI) signalling pins
```sig
pins.spiPins(DigitalPin.P0, DigitalPin.P1, DigitalPin.P2);
```
To configure the @boardname@ to write to an external device using a SPI connection, each SPI signal line is assigned to unique a pin. A SPI connection uses 3 signalling lines called **MOSI**, **MISO**, and **SCK**.
### ~ hint
**Simulator**: This function needs real hardware to work with. It's not supported in the simulator.
### ~
If you don't set the pins for the SPI connection, the default pin assignments are used:
* **P15** = **MOSI**, @boardname@ SPI data output pin
* **P14** = **MISO**, @boardname@ SPI data input pin
* **P13** = **SCK**, @boardname@ SPI serial clock output pin
## Parameters
* **mosi**: the pin for SPI data output, the **MOSI** signal pin.
* **miso**: the pin for SPI data input, the **MISO** signal pin.
* **sck**: the pin for SPI serial clock output, the **SCK** signal pin.
## Example
Set the pin assignments for a SPI connection to the default pins.
```blocks
pins.spiPins(DigitalPin.C15, DigitalPin.C14, DigitalPin.C13);
```
## See also
[spi write](/reference/pins/spi-write),
[spi frequency](/reference/pins/spi-frequency),
[spi format](/reference/pins/spi-format)
[SPI Programming](https://developer.mbed.org/handbook/SPI)