模板:Board

来自百问网嵌入式Linux wiki

Usage

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 part number codification for the STM32MP15 MPUs):
    • 157A-EV1: STM32MP157A-EV1 Evaluation board
    • 157D-EV1: STM32MP157D-EV1 Evaluation board (June 2020: not available)
    • 157C-EV1: STM32MP157C-EV1 Evaluation board
    • 157F-EV1: STM32MP157F-EV1 Evaluation board
    • 157A/D-EV1: STM32MP157A-EV1 or STM32MP157D-EV1 Evaluation board (June 2020: STM32MP157D-EV1 not available)
    • 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 (June 2020: not available)
    • 157C-DK2: STM32MP157C-DK2 Discovery kit
    • 157F-DK2: STM32MP157F-DK2 Discovery kit (June 2020: not available)
    • 157x-DK1: STM32MP157A-DK1 or STM32MP157D-DK1 Discovery kit (June 2020: STM32MP157D-DK1 not available)
    • 157x-DK2: STM32MP157C-DK2 or STM32MP157F-DK2 Discovery kit (June 2020: STM32MP157F-DK2 not available)
    • 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.

Basic examples

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157F-EV1{{#var:typ}} {{#var:info}}

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|More info green.png}}STM32MP157C-DK2{{#var:typ}} {{#var:info}}

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157A-DK1{{#var:typ}} {{#var:info}}

More examples

You type You get
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}}

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157A-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|Warning.png}}STM32MP157D-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157F-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|Warning.png}}STM32MP157A/D-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157C/F-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157x-EV1{{#var:typ}} {{#var:info}}

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}}

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|More info green.png}}STM32MP157A-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|Warning.png}}STM32MP157D-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|More info green.png}}STM32MP157C-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|Warning.png}}STM32MP157F-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|Warning.png}}STM32MP157x-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|Warning.png}}STM32MP157x-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|More info green.png}}STM32MP157x-DKx{{#var:typ}} {{#var:info}}

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}}

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157A-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157D-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157F-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157A/D-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157C/F-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157x-EV1{{#var:typ}} {{#var:info}}

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}}

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157A-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157D-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157C-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157F-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157x-DK1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|Warning.png}}STM32MP157x-DK2{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:info|More info green.png}}STM32MP157x-DKx{{#var:typ}} {{#var:info}}

Unspecified board
{{Board}}

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| unknown board type identifier}}STM32MP{{#var:typ}} {{#var:info}}

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| unknown board type identifier}}STM32MP153C-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| unknown board type identifier}}STM32MP157C-DK3{{#var:typ}} {{#var:info}}

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

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}
{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}

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>

BEFORE{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Evaluation board}}{{#vardefine:info|More info green.png}}STM32MP157C-EV1{{#var:typ}} {{#var:info}}AFTER
BEFORE{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| Discovery kit}}{{#vardefine:info|More info green.png}}STM32MP157C-DK2{{#var:typ}} {{#var:info}}AFTER

Code

{{#vardefine:info|}}{{#vardefine:typ|}}{{#vardefine:typ| unknown board type identifier}}STM32MP{{#var:typ}} {{#var:info}}