Skip to content

Commit

Permalink
DOCS-1220: Add pumpkin board (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Oct 9, 2023
1 parent 7c69edc commit 2496e8d
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 0 deletions.
Binary file added assets/components/board/customlinux-ui-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/installation/thumbnails/pumpkin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ sitemap:
<p>Texas Instruments TDA4VM</p>
</a>
</li>
<li id="c1_slide14">
<a href="components/board/customlinux/">
{{<imgproc src="installation/thumbnails/pumpkin.png" resize="148x120" declaredimensions=true alt="pumpkin board">}}
<p>Pumpkin i500</p>
</a>
</li>
</ul>
<ol style="visibility: hidden" aria-hidden="true">
<li><a href="#c1_slide1">NVIDIA Jetson Nano</a></li>
Expand All @@ -113,6 +119,7 @@ sitemap:
<li><a href="#c1_slide11">Numato GPIO Modules</a></li>
<li><a href="#c1_slide12">PCA9686 I<sup>2</sup>C Interface</a></li>
<li><a href="#c1_slide13">Texas Instruments TDA4VM</a></li>
<li><a href="#c1_slide14">Pumpkin i500</a></li>
</ol>
<div class="prev" style="display: block">‹</div>
<div class="next" style="display: block">›</div>
Expand Down
1 change: 1 addition & 0 deletions docs/components/board/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ For model-specific configuration information, click on one of the following mode
| [`pca9685`](pca9685/) | [PCA9685 Arduino I<sup>2</sup>C Interface](https://www.adafruit.com/product/815), a 16-channel [I<sup>2</sup>C](#i2cs) [PWM](https://docs.arduino.cc/learn/microcontrollers/analog-output)/[servo](/components/servo/) driver peripheral |
| [`upboard`](upboard/) | An Intel-based board like the [UP4000](https://github.com/up-board/up-community/wiki/Pinout_UP4000) |
| [`fake`](fake/) | A model used for testing, with no physical hardware |
| [`customlinux`](customlinux/) | A model for other linux boards. |
| other | You can use other boards with modular components such as [`periph_board`](https://github.com/viam-labs/periph_board) |

## Attribute Configuration
Expand Down
313 changes: 313 additions & 0 deletions docs/components/board/customlinux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,313 @@
---
title: "Configure a customlinux board"
linkTitle: "customlinux"
weight: 75
type: "docs"
description: "Configure a customlinux board."
images: ["/icons/components/board.svg"]
tags: ["board", "components"]
# SMEs: Susmita
---

Configure a `customlinux` board to integrate linux boards like the [Pumpkin i500](https://ologicinc.com/portfolio/mediateki500/) into your robot.

Complete the following setup requirements, then move on to configuring your board in the [Viam app](https://app.viam.com):

## Setup requirements

- Create a new robot in the [Viam app](https://app.viam.com) and follow the steps on the [setup tab](/installation/#installation-steps) to [install `viam-server`](/installation/) on your `customlinux` board and connect your board to the Viam app.
- On your `customlinux` board, create a file in your <file>/home/root</file> directory called <file>board.json</file> with your board's pin mappings:

{{< tabs >}}
{{% tab name="Template" %}}

```json
{
"pins": [
{
"name": "<pin-name>",
"device_name": "<device-name>",
"line_number": <integer>,
"pwm_id": <integer>
},
...
]
}
```

{{% /tab %}}
{{% tab name="Pumpkin Board Example" %}}

```json
{
"pins": [
{
"name": "3",
"device_name": "gpiochip0",
"line_number": 81,
"pwm_id": -1
},
{
"name": "5",
"device_name": "gpiochip0",
"line_number": 84,
"pwm_id": -1
},
{
"name": "7",
"device_name": "gpiochip0",
"line_number": 150,
"pwm_id": -1
},
{
"name": "11",
"device_name": "gpiochip0",
"line_number": 173,
"pwm_id": -1
},
{
"name": "13",
"device_name": "gpiochip0",
"line_number": 152,
"pwm_id": -1
},
{
"name": "15",
"device_name": "gpiochip0",
"line_number": 94,
"pwm_id": -1
},
{
"name": "19",
"device_name": "gpiochip0",
"line_number": 163,
"pwm_id": -1
},
{
"name": "21",
"device_name": "gpiochip0",
"line_number": 161,
"pwm_id": -1
},
{
"name": "23",
"device_name": "gpiochip0",
"line_number": 164,
"pwm_id": -1
},
{
"name": "27",
"device_name": "gpiochip0",
"line_number": 82,
"pwm_id": -1
},
{
"name": "29",
"device_name": "gpiochip0",
"line_number": 98,
"pwm_id": -1
},
{
"name": "31",
"device_name": "gpiochip0",
"line_number": 12,
"pwm_id": -1
},
{
"name": "33",
"device_name": "gpiochip0",
"line_number": 101,
"pwm_id": -1
},
{
"name": "35",
"device_name": "gpiochip0",
"line_number": 171,
"pwm_id": -1
},
{
"name": "37",
"device_name": "gpiochip0",
"line_number": 169,
"pwm_id": -1
},
{
"name": "8",
"device_name": "gpiochip0",
"line_number": 115,
"pwm_id": -1
},
{
"name": "10",
"device_name": "gpiochip0",
"line_number": 121,
"pwm_id": -1
},
{
"name": "12",
"device_name": "gpiochip0",
"line_number": 170,
"pwm_id": -1
},
{
"name": "16",
"device_name": "gpiochip0",
"line_number": 165,
"pwm_id": -1
},
{
"name": "18",
"device_name": "gpiochip0",
"line_number": 1,
"pwm_id": -1
},
{
"name": "22",
"device_name": "gpiochip0",
"line_number": 2,
"pwm_id": -1
},
{
"name": "24",
"device_name": "gpiochip0",
"line_number": 162,
"pwm_id": -1
},
{
"name": "26",
"device_name": "gpiochip0",
"line_number": 0,
"pwm_id": -1
},
{
"name": "28",
"device_name": "gpiochip0",
"line_number": 83,
"pwm_id": -1
},
{
"name": "32",
"device_name": "gpiochip0",
"line_number": 97,
"pwm_id": -1
},
{
"name": "36",
"device_name": "gpiochip0",
"line_number": 151,
"pwm_id": -1
},
{
"name": "38",
"device_name": "gpiochip0",
"line_number": 174,
"pwm_id": -1
},
{
"name": "40",
"device_name": "gpiochip0",
"line_number": 172,
"pwm_id": -1
}
]
}
```

{{% /tab %}}
{{< /tabs >}}

The following parameters are available for pin mappings:

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `name` | string | **Required** | The name of the pin. <br> Example: `"3"`. |
| `device_name` | string | **Required** | The device name. <br> Example: `"gpiochip0"`. |
| `line_number` | integer | **Required** | The line number of the pin. <br> Example: `81`. |
| `pwm_id` | integer | **Required** | The power management id of the pin. Example: `-1`. |

## Configure your board

{{< tabs name="Configure a customlinux board" >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com).
Click on the **Components** subtab and click **Create component**.
Select the `board` type, then select the `customlinux` model.
Enter a name for your `customlinux` board and click **Create**.

![An example configuration for a customlinux board in the Viam app Config Builder.](/components/board/customlinux-ui-config.png)

Copy and paste the following attribute template into your board's **Attributes** box.
Then edit the attribute as applicable to your board, according to the table below.

{{< tabs >}}
{{% tab name="Attributes template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"board_defs_file_path": "<file_path>"
}
```

{{% /tab %}}
{{% tab name="Attributes example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"board_defs_file_path": "/home/root/board.json"
}
```

{{% /tab %}}
{{< /tabs >}}

{{% /tab %}}
{{% tab name="JSON Template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "<your-customlinux-board>",
"model": "customlinux",
"type": "board",
"namespace": "rdk",
"attributes": {
"board_defs_file_path": "<file_path>"
},
"depends_on": []
}
]
}
```

{{% /tab %}}
{{% tab name="JSON Example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "myCustomBoard",
"model": "customlinux",
"type": "board",
"namespace": "rdk",
"attributes": {
"board_defs_file_path": "/home/root/board.json"
},
"depends_on": []
}
]
}
```

{{% /tab %}}
{{< /tabs >}}

The following attributes are available for `board/customlinux` boards:

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `board_defs_file_path` | string | **Required** | The path to the pin mappings. See [Setup requirements](#setup-requirements). |

0 comments on commit 2496e8d

Please sign in to comment.