Add detailed pin mapping explanation to underglow docs (#709)
* Update underglow.md
Updated the documentation according to my current understandring of how to pin-mapping works, also split the chapter into a nrf-section and a non-nrf-section since that information isn't applicable to both
* Ran prettier and updated pin reference according to suggestion
@ -55,10 +55,16 @@ If you have a shield with RGB underglow, you must add a `boards/` directory with
Inside the `boards/` folder, you define a `<board>.overlay` for each different board.
Inside the `boards/` folder, you define a `<board>.overlay` for each different board.
For example, the Kyria shield has a `boards/nice_nano.overlay` file that defines the RGB underglow for the `nice_nano` board specifically.
For example, the Kyria shield has a `boards/nice_nano.overlay` file that defines the RGB underglow for the `nice_nano` board specifically.
The first step to adding support for underglow is to select you SPI output. With nRF52 boards, you can just use `&spi1` and define the pins you want to use.
### nRF52-based boards
For other boards, you must select an SPI definition that has the `MOSI` pin as your data pin going to your LED strip.
With nRF52 boards, you can just use `&spi1` and define the pins you want to use.
To identify which pin number you need to put in the config you need do to a bit of math. You need the hardware port and run it through a function.
**32 \* X + Y** = `<Pin number>` where X is first part of the hardware port "PX.01" and Y is the second part of the hardware port "P1.Y".
(_P1.13_ would give you _32 \* 1 + 13_ = `<45>` and P0.15 would give you _32 \* 0 + 15_ = `<15>`)
Here's an example of an nRF52 SPI definition:
Here's an example on a definition that uses P0.06:
```
```
&spi1 {
&spi1 {
@ -87,11 +93,15 @@ Here's an example of an nRF52 SPI definition:
:::info
:::info
If you are configuring SPI for an nRF52840 (or other nRF52) based board, double check that you are using pins that aren't restricted to low frequency I/O.
If you are configuring SPI for an nRF52 based board, double check that you are using pins that aren't restricted to low frequency I/O.
Ignoring these restrictions may result in poor wireless performance. You can find the list of low frequency I/O pins [here](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpin.html&cp=4_0_0_6_0).
Ignoring these restrictions may result in poor wireless performance. You can find the list of low frequency I/O pins for the nRF52840 [here](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpin.html&cp=4_0_0_6_0).
:::
:::
### Other boards
For other boards, you must select an SPI definition that has the `MOSI` pin as your data pin going to your LED strip.
Here's another example for a non-nRF52 board on `spi1`:
Here's another example for a non-nRF52 board on `spi1`: