Difference between revisions of "Template:Board"

[unchecked revision] [quality revision]
m
m

1 Usage[edit]

The Board template is used to indicate for which board(s), an article part (chapter, paragraph, table...) is valid. Per default (i.e. if this template is not used), any part of an article is valid for all boards for which the entire article is valid.

It outputs a "standardized" string that might be used to name an article part.

Usage: {{Board | type=<type> | name=<name>}}
Where:
  • <type> is the mandatory identifier of the board type. The possible values are (see also the STM32MP15 part number codification for the STM32MP15 MPUs and the STM32MP13 part number codification for the STM32MP13 MPUs):
    • 135x-DK: any Discovery kit with a STM32MP135 MPU
    • 135D-DK: STM32MP135D-DK Discovery kit
    • 135F-DK: STM32MP135F-DK Discovery kit
    • 157A-EV1: STM32MP157A-EV1 Evaluation board
    • 157D-EV1: STM32MP157D-EV1 Evaluation board
    • 157C-EV1: STM32MP157C-EV1 Evaluation board
    • 157F-EV1: STM32MP157F-EV1 Evaluation board
    • 157A/D-EV1: STM32MP157A-EV1 or STM32MP157D-EV1 Evaluation board
    • 157C/F-EV1: STM32MP157C-EV1 or STM32MP157F-EV1 Evaluation board
    • 157x-EV1: any Evaluation board with a STM32MP157 MPU
    • 157A-DK1: STM32MP157A-DK1 Discovery kit
    • 157D-DK1: STM32MP157A-DK1 Discovery kit
    • 157C-DK2: STM32MP157C-DK2 Discovery kit
    • 157F-DK2: STM32MP157F-DK2 Discovery kit
    • 157x-DK1: STM32MP157A-DK1 or STM32MP157D-DK1 Discovery kit
    • 157x-DK2: STM32MP157C-DK2 or STM32MP157F-DK2 Discovery kit
    • 157x-DKx: any Discovery kit with a STM32MP157 MPU
  • <name> is the optional parameter that allows to select the way the board name is displayed. Per default (if <name> is not set), the full board name (i.e. including "Evaluation board" or "Discovery kit") is displayed. The possible value for <name> is:
    • short: the short board name (i.e without "Evaluation board" and "Discovery kit") is displayed

The More info green.png icon indicates that the board is already available, and clicking on this icon links to the article about the boards hardware description (e.g. STM32MP157x-DKx - hardware description).

The Warning.png icon indicates that the board is currently not available.

2 Basic examples[edit]

You type You get
STM32MP135x-DK Discovery kit
{{Board | type=135x-DK}}

STM32MP135x-DK Discovery kit Warning.png

STM32MP135D-DK Discovery kit
{{Board | type=135D-DK}}

STM32MP135D-DK Discovery kit Warning.png

STM32MP135F-DK Discovery kit
{{Board | type=135F-DK}}

STM32MP135F-DK Discovery kit Warning.png

STM32MP157F-EV1 Evaluation board
{{Board | type=157F-EV1}}

STM32MP157F-EV1 Evaluation board More info green.png

STM32MP157C-DK2 Discovery kit
{{Board | type=157C-DK2}}

STM32MP157C-DK2 Discovery kit Warning.png

STM32MP157C-EV1
{{Board | type=157C-EV1 | name=short}}

STM32MP157C-EV1 Warning.png

STM32MP157A-DK1
{{Board | type=157A-DK1 | name=short}}

STM32MP157A-DK1 Warning.png

STM32MP135D-DK
{{Board | type=135D-DK | name=short}}

STM32MP135D-DK Warning.png

STM32MP135F-DK
{{Board | type=135F-DK  | name=short}}

STM32MP135F-DK Warning.png

3 More examples[edit]

You type You get
Discovery kits with a STM32MP135 MPU
{{Board | type=135D-DK}}<br>
{{Board | type=135F-DK}}<br>

STM32MP135D-DK Discovery kit Warning.png
STM32MP135F-DK Discovery kit Warning.png

Discovery kits with a STM32MP135 MPU: short name
{{Board | type=135D-DK | name=short}}<br>
{{Board | type=135F-DK | name=short}}<br>

STM32MP135D-DK Warning.png
STM32MP135F-DK Warning.png

Evaluation boards with a STM32MP157 MPU
{{Board | type=157A-EV1}}<br>
{{Board | type=157D-EV1}}<br>
{{Board | type=157C-EV1}}<br>
{{Board | type=157F-EV1}}<br>
{{Board | type=157A/D-EV1}}<br>
{{Board | type=157C/F-EV1}}<br>
{{Board | type=157x-EV1}}

STM32MP157A-EV1 Evaluation board Warning.png
STM32MP157D-EV1 Evaluation board More info green.png
STM32MP157C-EV1 Evaluation board Warning.png
STM32MP157F-EV1 Evaluation board More info green.png
STM32MP157A/D-EV1 Evaluation board More info green.png
STM32MP157C/F-EV1 Evaluation board More info green.png
STM32MP157x-EV1 Evaluation board More info green.png

Discovery kits with a STM32MP157 MPU
{{Board | type=157A-DK1}}<br>
{{Board | type=157D-DK1}}<br>
{{Board | type=157C-DK2}}<br>
{{Board | type=157F-DK2}}<br>
{{Board | type=157x-DK1}}<br>
{{Board | type=157x-DK2}}<br>
{{Board | type=157x-DKx}}

STM32MP157A-DK1 Discovery kit Warning.png
STM32MP157D-DK1 Discovery kit More info green.png
STM32MP157C-DK2 Discovery kit Warning.png
STM32MP157F-DK2 Discovery kit More info green.png
STM32MP157x-DK1 Discovery kit More info green.png
STM32MP157x-DK2 Discovery kit More info green.png
STM32MP157x-DKx Discovery kit More info green.png

Evaluation boards with a STM32MP157 MPU: short name
{{Board | type=157A-EV1 | name=short}}<br>
{{Board | type=157D-EV1 | name=short}}<br>
{{Board | type=157C-EV1 | name=short}}<br>
{{Board | type=157F-EV1 | name=short}}<br>
{{Board | type=157A/D-EV1 | name=short}}<br>
{{Board | type=157C/F-EV1 | name=short}}<br>
{{Board | type=157x-EV1 | name=short}}

STM32MP157A-EV1 Warning.png
STM32MP157D-EV1 More info green.png
STM32MP157C-EV1 Warning.png
STM32MP157F-EV1 More info green.png
STM32MP157A/D-EV1 More info green.png
STM32MP157C/F-EV1 More info green.png
STM32MP157x-EV1 More info green.png

Discovery kits with a STM32MP157 MPU: short name
{{Board | type=157A-DK1 | name=short}}<br>
{{Board | type=157D-DK1 | name=short}}<br>
{{Board | type=157C-DK2 | name=short}}<br>
{{Board | type=157F-DK2 | name=short}}<br>
{{Board | type=157x-DK1 | name=short}}<br>
{{Board | type=157x-DK2 | name=short}}<br>
{{Board | type=157x-DKx | name=short}}

STM32MP157A-DK1 Warning.png
STM32MP157D-DK1 More info green.png
STM32MP157C-DK2 Warning.png
STM32MP157F-DK2 More info green.png
STM32MP157x-DK1 More info green.png
STM32MP157x-DK2 More info green.png
STM32MP157x-DKx More info green.png

Unspecified board
{{Board}}

STM32MP unknown board type identifier

Unknown boards
{{Board | type=153C-EV1}}<br>
{{Board | type=157C-DK3}}

STM32MP153C-EV1 unknown board type identifier
STM32MP157C-DK3 unknown board type identifier

Unknown value for <name>
{{Board | type=157C-EV1 | name=long}}<br>
{{Board | type=157C-EV1 | name=}}

STM32MP157C-EV1 Evaluation board Warning.png
STM32MP157C-EV1 Evaluation board Warning.png

Check that there's no space before and after the text
BEFORE{{Board | type=157C-EV1}}AFTER<br>
BEFORE{{Board | type=157C-DK2}}AFTER<br>

BEFORESTM32MP157C-EV1 Evaluation board Warning.pngAFTER
BEFORESTM32MP157C-DK2 Discovery kit Warning.pngAFTER

4 Code[edit]

Example :

{{#vardefine:info|}}{{#vardefine:typ|}}{{#switch:{{{type|}}}
| 157A-EV1 | 157C-EV1 | 157F-EV1 | 157C/F-EV1 | 157x-EV1= {{#ifeq: {{{name}}} | short | | {{#vardefine:typ| Evaluation board}}}}{{#vardefine:info|<sup>[[File:More_info_green.png|15px|link=STM32MP157x-EV1 - hardware description]]</sup>}}
| 157D-EV1 | 157A/D-EV1 = {{#ifeq: {{{name}}} | short | | {{#vardefine:typ| Evaluation board}}}}{{#vardefine:info|<span title="STM32MP157D-EV1 not available"><sup>[[File:Warning.png|15px|link=]]</sup></span>}}
[[File:Warning.png|15px|link=]]</sup></span>}}

STM32MP unknown board type identifier

<noinclude>

==Usage==
The [[Template:Board|Board]] template is used '''to indicate for which board(s), an article part (chapter, paragraph, table...) is valid'''. Per default (i.e. if this template is not used), any part of an article is valid for all boards for which the entire article is valid.

It outputs a "standardized" string that might be used to name an article part.

 Usage: <nowiki>{{</nowiki>Board | type={{HighlightParam|<type>}} | name={{HighlightParam|<name>}}}}
:Where:
{{ReviewsComments|-- [[User:Jean Christophe Trotin|Jean Christophe Trotin]] ([[User talk:Jean Christophe Trotin|talk]]) 10:59, 2 December 2021 (CET)<br />To me, there is a slight inconsistency between "135x-DK" (no "x" after DK) and the hardware article name "STM32MP135x-DKx - hardware description" ("x" after DK). Currently, there is only 1 DK that is named STM32MP135F-DK (nothing after DK. So,
* either there is always an "x" after DK in case someone imagines later a DK1 or DK2 or ...: Then we should rename "135x-DK" as "135x-DKx"
* or there is never an "x" after DK because there will never be a DK1 or DK2 or ...:Then we should keep "135x-DK" and rename "STM32MP135x-DKx - hardware description"<br> NSA : done}}

* * {{HighlightParam|<type>}} is the '''mandatory''' identifier of the board type. The possible values are (see also the [[STM32MP15 microprocessor#Part number codification|STM32MP15 part number codification]] for the STM32MP15 MPUs  and the [[STM32MP13 microprocessor#Part number codification|STM32MP13 part number codification]] for the STM32MP13 MPUs):
** '''135x-DK''': any Discovery kit with a STM32MP135 MPU
** '''135D-DK''': STM32MP135D-DK Discovery kit
** '''135F-DK''': STM32MP135F-DK Discovery kit
** '''157A-EV1''': STM32MP157A-EV1 Evaluation board
** '''157D-EV1''': STM32MP157D-EV1 Evaluation board 
** '''157C-EV1''': STM32MP157C-EV1 Evaluation board
** '''157F-EV1''': STM32MP157F-EV1 Evaluation board
** '''157A/D-EV1''':  STM32MP157A-EV1 or STM32MP157D-EV1 Evaluation board
** '''157C/F-EV1''':  STM32MP157C-EV1 or STM32MP157F-EV1 Evaluation board
** '''157x-EV1''':  any Evaluation board with a STM32MP157 MPU
** '''157A-DK1''': STM32MP157A-DK1 Discovery kit
** '''157D-DK1''': STM32MP157A-DK1 Discovery kit 
** '''157C-DK2''': STM32MP157C-DK2 Discovery kit
** '''157F-DK2''': STM32MP157F-DK2 Discovery kit
** '''157x-DK1''': STM32MP157A-DK1 or STM32MP157D-DK1 Discovery kit
** '''157x-DK2''': STM32MP157C-DK2 or STM32MP157F-DK2 Discovery kit
** '''157x-DKx''': any Discovery kit with a STM32MP157 MPU
* {{HighlightParam|<name>}} is the '''optional''' parameter that allows to select the way the board name is displayed. Per default (if {{HighlightParam|<name>}} is not set), the full board name (i.e. including "Evaluation board" or "Discovery kit") is displayed. The possible value for {{HighlightParam|<name>}} is:
** '''short''': the short board name (i.e without "Evaluation board" and "Discovery kit") is displayed

The <sup>[[File:More_info_green.png|15px|link=]]</sup> icon indicates that the board is already available, and clicking on this icon links to '''the article about the boards hardware description''' (e.g. [[STM32MP157x-DKx - hardware description]]).

The <sup>[[File:Warning.png|15px|link=]]</sup> icon indicates that the board is currently not available.

==Basic examples==
{| class="st-table"
! style="width: 50%;" | You type !! You get
|-
| STM32MP135x-DK Discovery kit<pre style="white-space: pre-wrap;">

{{Board | type=135x-DK}}</pre>

|
{{Board | type=135x-DK}}
|-
| STM32MP135D-DK Discovery kit<pre style="white-space: pre-wrap;">

{{Board | type=135D-DK}}</pre>

|
{{Board | type=135D-DK}}
|-
| STM32MP135F-DK Discovery kit<pre style="white-space: pre-wrap;">

{{Board | type=135F-DK}}</pre>

|
{{Board | type=135F-DK}}
|-
| STM32MP157F-EV1 Evaluation board<pre style="white-space: pre-wrap;">

{{Board | type=157F-EV1}}</pre>

|
{{Board | type=157F-EV1}}
|-
| STM32MP157C-DK2 Discovery kit<pre style="white-space: pre-wrap;">

{{Board | type=157C-DK2}}</pre>

|
{{Board | type=157C-DK2}}
|-
| STM32MP157C-EV1<pre style="white-space: pre-wrap;">

{{Board | type=157C-EV1 | name=short}}</pre>

|
{{Board | type=157C-EV1 | name=short}}
|-
| STM32MP157A-DK1<pre style="white-space: pre-wrap;">

{{Board | type=157A-DK1 | name=short}}</pre>

|
{{Board | type=157A-DK1 | name=short}}
|-
| STM32MP135D-DK<pre style="white-space: pre-wrap;">

{{Board | type=135D-DK | name=short}}</pre>

|
{{Board | type=135D-DK | name=short}}
|-
| STM32MP135F-DK<pre style="white-space: pre-wrap;">

{{Board | type=135F-DK  | name=short}}</pre>

|
{{Board | type=135F-DK | name=short}}
|}

==More examples==
{| class="st-table"
! style="width: 50%;" | You type !! You get
|-
| Discovery kits with a STM32MP135 MPU<pre style="white-space: pre-wrap;">

{{Board | type=135D-DK}}<br>

{{Board | type=135F-DK}}<br>
</pre>

|
{{Board | type=135D-DK}}<br>

{{Board | type=135F-DK}}<br>

|-
| Discovery kits with a STM32MP135 MPU: short name<pre style="white-space: pre-wrap;">

{{Board | type=135D-DK | name=short}}<br>

{{Board | type=135F-DK | name=short}}<br>
</pre>

|
{{Board | type=135D-DK | name=short}}<br>

{{Board | type=135F-DK | name=short}}<br>

|-
| Evaluation boards with a STM32MP157 MPU<pre style="white-space: pre-wrap;">

{{Board | type=157A-EV1}}<br>

{{Board | type=157D-EV1}}<br>

{{Board | type=157C-EV1}}<br>

{{Board | type=157F-EV1}}<br>

{{Board | type=157A/D-EV1}}<br>

{{Board | type=157C/F-EV1}}<br>

{{Board | type=157x-EV1}}</pre>

|
{{Board | type=157A-EV1}}<br>

{{Board | type=157D-EV1}}<br>

{{Board | type=157C-EV1}}<br>

{{Board | type=157F-EV1}}<br>

{{Board | type=157A/D-EV1}}<br>

{{Board | type=157C/F-EV1}}<br>

{{Board | type=157x-EV1}}
|-
| Discovery kits with a STM32MP157 MPU<pre style="white-space: pre-wrap;">

{{Board | type=157A-DK1}}<br>

{{Board | type=157D-DK1}}<br>

{{Board | type=157C-DK2}}<br>

{{Board | type=157F-DK2}}<br>

{{Board | type=157x-DK1}}<br>

{{Board | type=157x-DK2}}<br>

{{Board | type=157x-DKx}}</pre>

|
{{Board | type=157A-DK1}}<br>

{{Board | type=157D-DK1}}<br>

{{Board | type=157C-DK2}}<br>

{{Board | type=157F-DK2}}<br>

{{Board | type=157x-DK1}}<br>

{{Board | type=157x-DK2}}<br>

{{Board | type=157x-DKx}}
|-
| Evaluation boards with a STM32MP157 MPU: short name<pre style="white-space: pre-wrap;">

{{Board | type=157A-EV1 | name=short}}<br>

{{Board | type=157D-EV1 | name=short}}<br>

{{Board | type=157C-EV1 | name=short}}<br>

{{Board | type=157F-EV1 | name=short}}<br>

{{Board | type=157A/D-EV1 | name=short}}<br>

{{Board | type=157C/F-EV1 | name=short}}<br>

{{Board | type=157x-EV1 | name=short}}</pre>

|
{{Board | type=157A-EV1 | name=short}}<br>

{{Board | type=157D-EV1 | name=short}}<br>

{{Board | type=157C-EV1 | name=short}}<br>

{{Board | type=157F-EV1 | name=short}}<br>

{{Board | type=157A/D-EV1 | name=short}}<br>

{{Board | type=157C/F-EV1 | name=short}}<br>

{{Board | type=157x-EV1 | name=short}}
|-
| Discovery kits with a STM32MP157 MPU: short name<pre style="white-space: pre-wrap;">

{{Board | type=157A-DK1 | name=short}}<br>

{{Board | type=157D-DK1 | name=short}}<br>

{{Board | type=157C-DK2 | name=short}}<br>

{{Board | type=157F-DK2 | name=short}}<br>

{{Board | type=157x-DK1 | name=short}}<br>

{{Board | type=157x-DK2 | name=short}}<br>

{{Board | type=157x-DKx | name=short}}</pre>

|
{{Board | type=157A-DK1 | name=short}}<br>

{{Board | type=157D-DK1 | name=short}}<br>

{{Board | type=157C-DK2 | name=short}}<br>

{{Board | type=157F-DK2 | name=short}}<br>

{{Board | type=157x-DK1 | name=short}}<br>

{{Board | type=157x-DK2 | name=short}}<br>

{{Board | type=157x-DKx | name=short}}
|-
| Unspecified board<pre style="white-space: pre-wrap;">

{{Board}}</pre>

|
{{Board}}
|-
| Unknown boards<pre style="white-space: pre-wrap;">

{{Board | type=153C-EV1}}<br>

{{Board | type=157C-DK3}}</pre>

|
{{Board | type=153C-EV1}}<br>

{{Board | type=157C-DK3}}
|-
| Unknown value for {{HighlightParam|<name>}}<pre style="white-space: pre-wrap;">

{{Board | type=157C-EV1 | name=long}}<br>

{{Board | type=157C-EV1 | name=}}</pre>

|
{{Board | type=157C-EV1 | name=long}}<br>

{{Board | type=157C-EV1 | name=}}
|-
| Check that there's no space before and after the text<pre style="white-space: pre-wrap;">

BEFORE{{Board | type=157C-EV1}}AFTER<br>

BEFORE{{Board | type=157C-DK2}}AFTER<br>
</pre>

|
BEFORE{{Board | type=157C-EV1}}AFTER<br>

BEFORE{{Board | type=157C-DK2}}AFTER<br>

|}

==Code==
{{UpdateNeededForNewBoard|  Add the new board in the code below and in the list of the possible values above. Make sure that the [[Contributors:Formatting#Lead_section|Lead section]] is available for all referenced articles }}
Example :<pre>

{{#vardefine:info|}}{{#vardefine:typ|}}{{#switch:{{{type|}}}
| 157A-EV1 | 157C-EV1 | 157F-EV1 | 157C/F-EV1 | 157x-EV1= {{#ifeq: {{{name}}} | short | | {{#vardefine:typ|&nbsp;Evaluation board}}}}{{#vardefine:info|<sup>[[File:More_info_green.png|15px|link=STM32MP157x-EV1 - hardware description]]</sup>}}
| 157D-EV1 | 157A/D-EV1 = {{#ifeq: {{{name}}} | short | | {{#vardefine:typ|&nbsp;Evaluation board}}}}{{#vardefine:info|<span title="STM32MP157D-EV1 not available"><sup>[[File:Warning.png|15px|link=]]</sup></span>}}
[[File:Warning.png|15px|link=]]</sup></span>}}</pre>

</noinclude>{{#vardefine:info|}}{{#vardefine:typ|}}{{#switch:{{{type|}}}
| 157A-EV1 | 157D-EV1 | 157A/D-EV1 | 157C-EV1 | 157F-EV1 |157C/F-EV1 | 157x-EV1 = {{#ifeq: {{{name}}} | short | | {{#vardefine:typ|&nbsp;Evaluation board}}}}{{#vardefine:info|<sup>[[File:More_info_green.png|15px|link=STM32MP157x-EV1 - hardware description]]</sup>}}
| 157A-DK1 | 157D-DK1 | 157C-DK2 | 157F-DK2 | 157x-DK2 | 157x-DK1 | 157x-DKx  = {{#ifeq: {{{name}}} | short | | {{#vardefine:typ|&nbsp;Discovery kit}}}}{{#vardefine:info|<sup>[[File:More_info_green.png|15px|link=STM32MP157x-DKx - hardware description]]</sup>}}
| 135D-DK | 135F-DK | 135x-DK  = {{#ifeq: {{{name}}} | short | | {{#vardefine:typ|&nbsp;Discovery kit}}}}{{#vardefine:info|<sup>[[File:More_info_green.png|15px|link=STM32MP135x-DK - hardware description]]</sup>}}
| #default = {{#vardefine:typ|{{Highlight|&nbsp;unknown board type identifier}}}}
}}STM32MP{{{type|}}}{{#var:typ}} {{#var:info}}
Line 8: Line 8:
 
:Where:
 
:Where:
   
{{ReviewsComments|-- [[User:Jean Christophe Trotin|Jean Christophe Trotin]] ([[User talk:Jean Christophe Trotin|talk]]) 10:59, 2 December 2021 (CET)<br />To me, there is a slight inconsistency between "135x-DK" (no "x" after DK) and the hardware article name "STM32MP135x-DKx - hardware description" ("x" after DK). Currently, there is only 1 DK that is named STM32MP135F-DK (nothing after DK. So,
+
* {{HighlightParam|<type>}} is the '''mandatory''' identifier of the board type. The possible values are (see also the [[STM32MP15 microprocessor#Part number codification|STM32MP15 part number codification]] for the STM32MP15 MPUs  and the [[STM32MP13 microprocessor#Part number codification|STM32MP13 part number codification]] for the STM32MP13 MPUs):
* either there is always an "x" after DK in case someone imagines later a DK1 or DK2 or ...: Then we should rename "135x-DK" as "135x-DKx"
 
* or there is never an "x" after DK because there will never be a DK1 or DK2 or ...:Then we should keep "135x-DK" and rename "STM32MP135x-DKx - hardware description"<br> NSA : done}}
 
 
 
* {{HighlightParam|<type>}} is the '''mandatory''' identifier of the board type. The possible values are (see also the [[STM32MP15 microprocessor#Part number codification|part number codification]] for the STM32MP15 MPUs  and the [[STM32MP13 microprocessor#Part number codification|part number codification]] for the STM32MP13 MPUs):
 
 
** '''135x-DK''': any Discovery kit with a STM32MP135 MPU
 
** '''135x-DK''': any Discovery kit with a STM32MP135 MPU
 
** '''135D-DK''': STM32MP135D-DK Discovery kit
 
** '''135D-DK''': STM32MP135D-DK Discovery kit